Problems with 2.6.10-rc2-bk12 and directory entries

From: Holger Kiehl
Date: Tue Nov 30 2004 - 04:32:31 EST


Hello

Using 2.6.10-rc2-bk12 on a dual Xeon which serves files at a high rate
(>200 files/second), I noticed that when doing:

ptr = dirname + strlen(dirname);
dp = opendir(dirname);
while ((dirp = readdir(dp)) != NULL)
{
if ((dirp->d_name[0] == '.') && ((dirp->d_name[1] == '\0') ||
((dirp->d_name[1] == '.') && (dirp->d_name[2] == '\0'))))
{
continue;
}
strcpy(ptr, dirp->d_name);
if (unlink(dirname) == -1)
{
if (errno == ENOENT)
{
print some error
}
}
}

That under higher load it happens that the unlink fails with ENOENT. And
this is true because the file was unlinked by a previous call. So it seems
that readdir() returns some file name that has already been removed.
This is not the only place, I have other code pathes where this also happens,
for example where I move the files away instead of unlinking.

This did not happen with 2.6.7 or any kernels before that. Filesystem is
ext3 without any extensions.

Is this a known problem? What can I do to resolve this?

Thanks,
Holger

PS: Please CC me since I am not on the list.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/