Vincent Lefevre wrote: > In short, ext3 is bad for renames, but if Bob Proulx's suggestion > were implemented (without a workaround such that caching the whole > directory after it is opened[*]), it would be much worse as arbitrary > entries would be missed in a readdir sequence.
To be clear I didn't suggest that it be done that way. The reverse, actually. Wondering does not make it a suggestion. I always thought there must be a good reason they didn't do it that way but I didn't know what it was. Which is why I wondered about it. Kushal's reasoning as to why makes a lot of sense to me. > [*] Doing that would also solve the problem with renames. As to caching the entire directory that would also create a burden. Directories are multiple blocks long. The kernel would need to guarantee that multiple blocks are read atomically. This caching would be required to happen in the kernel memory space because the program doesn't know about it. It would effectively create a need to lock multiple kernel pages in memory potentially for the duration of the process lifetime. I wouldn't do it that way. I can imagine a local denial of service attack. Just keep opening directories. Although there could be process limits placed upon it in addition to the open file descriptor limit. Some kernels such as Hurd try hard to eliminate limits such as these. Bob
signature.asc
Description: Digital signature