Re: readdir loses renamed files

From: Jan Engelhardt
Date: Mon Oct 25 2004 - 07:52:03 EST


>So if I lose a file, how many times should I scan the directory again
>to know if it's really gone? And is it really worth the extra overhead

Maybe the use of stat() will show whether a file really exists.

>The test program that I had showed that the next scan didn't
>necessarily return it either. The file was sometimes lost for as long
>as 5 scans.

Unrelated to this issue, I had a look into reiser3 for some other project of
mine. What I've found was that upon renaming() a file, the old entry is marked
invisble first, and then the new one is marked visible.
You would need to meet a lot of conditions to have a file lost (IMO):
- using reiser3
- reiserfs_rename() is suspended for as long as 5 scans
(only happens either on SMP or UP+preempt)
- reiserfs_rename() hangs... somwhat, because while(i<5){while(readdir(...)){}}
usually takes longer than a rename


Jan Engelhardt
--
Gesellschaft für Wissenschaftliche Datenverarbeitung
Am Fassberg, 37077 Göttingen, www.gwdg.de
-
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/