On Sat, 2003-03-08 at 20:57, Andreas Aardal Hanssen wrote: > If renaming a file when a readdir is in progress causes that file (inode) > to be skipped, then the OS is IMO broken! ;) readdir just scans through > the list of files in a directory. The name of the file when it is stored > in the same path is simply metadata, and will from all I understand not > change its location (or existance) in the file list.
That depends entirely on the filesystem. If it has a flat inode list there's no problem. B-tree (or like) sorted by filename probably isn't problematic either, but just because we're not changing the file's base name (so the file stays in same place in the tree). But filesystems using a hash directory index (IIRC reiserfs, FreeBSD's fs)? That's where there's potential to miss files if readdir() is implemented by going through the hash. > I don't have any other experience here than what I have with ext2, but I > guess others on this list can enrichen this context. I think this is off-topic already :) Also ext2 is very bad performance filesystem for Maildir use, since it doesn't have any tree/hash directory indexes, ie. open() is slow with large mailboxes. There's some htree patch for it, but I don't know if that's already in default kernel.
