On Sat, Sep 14, 2019 at 9:16 AM Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote: > > OK, folks, could you try the following? It survives the local beating > so far. This looks like the right solution to me. Keep the locking simple, take the dentry refcount as long as we keep a ref to it in "*res". However, the one thing that strikes me is that it looks to me like this means that the "cursor" and the dentry in "*res" are basically synonymous. Could we drop the cursor entirely, and just keep the ref to the last dentry we showd _as_ the cursor? Yes, this would mean that we'd keep a ref to the dentry across readdir() calls, and maybe that's a horrible idea. But is that all that different from keeping the ref to the dentry that is the directory itself? Linus