Re: PROBLEM: FUSE_NOTIFY_INVAL_ENTRY leaves stale negative dentry after c9ba789dad15

Miklos Szeredi <[email protected]>
Newsgroups dev.linux.lists.regressions,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-kernel
Message-ID <CAJfpegswAZv8OmDAcK-5u8kssAF1vZKe4gdDB2XPErAnoGFSYg@mail.gmail.com>
On Tue, 2 Jun 2026 at 01:43, NeilBrown <[email protected]> wrote:

> +               if (d_really_is_negative(child)) {
> +                       spin_lock(&child->d_lock);
> +                       if (d_really_is_negative(child)) {
> +                               fuse_dir_changed(parent);
> +                               if (!(flags & FUSE_EXPIRE_ONLY))
> +                                       __d_drop(entry);
> +                               fuse_invalidate_entry_cache(entry);
> +                               spin_unlock(&child->d_lock);
> +                               dput(child);
> +                               err = 0;
> +                               goto put_parent;
> +                       }
> +                       spin_unlock(&child->d_lock);
> +                       dput(child);
> +               } else {
> +                       entry = start_removing_dentry(dir, child);
> +                       dput(child);
> +                       if (IS_ERR(entry))
> +                               goto put_parent;

There are still races (move out from dir, unlink) that result in
EINVAL and ENOENT respectively, but AFAICS these cases need to be
retried instead of faling.  Rather convoluted.

Can you explain why exactly is this needed?

Thanks,
Miklos
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.