Messages in this thread | | | Date | Mon, 22 Oct 2001 13:29:33 -0400 (EDT) | From | Alexander Viro <> | Subject | Re: Kernel Compile in tmpfs crumples in 2.4.12 w/epoll patch |
| |
On Mon, 22 Oct 2001, Larry McVoy wrote:
> for (;;) { > lstat(dir); > while (e = readdir(..)) save(e->d_name); > lstat(dir) > if (dir size && dir mtime have NOT changed) break; > cleanup the array and go start over > } > sort entries > return sorted list > > The basic idea being that we first of all narrow the race window and > second of all detect the race in all cases where the mods to the dir > result in either a changed mtime or a changed size. So yes, that leaves > us open to cases where the size didn't change but the contents did but > I'll be ding danged if I can see a way around that.
There's none. Notice that if you want a coherent view of directory, you need something like the variant above anyway - even with FFS. New entry could've been added into slack in one of the entries you've already seen.
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |