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 <CAJfpegt=DphJP3pYHL6ZMzbYD4Yfmo_G+DAm496Ar57L0RzymA@mail.gmail.com>
On Tue, 2 Jun 2026 at 01:43, NeilBrown <[email protected]> wrote:

> diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
> index b658b6baf72f..3f16ecbc358e 100644
> --- a/fs/fuse/dir.c
> +++ b/fs/fuse/dir.c
> @@ -1605,13 +1605,29 @@ int fuse_reverse_inval_entry(struct fuse_conn *fc, u64 parent_nodeid,
>                 struct dentry *child = try_lookup_noperm(name, dir);
>                 if (!child || IS_ERR(child))
>                         goto put_parent;
> -               entry = start_removing_dentry(dir, child);
> -               dput(child);
> -               if (IS_ERR(entry))
> -                       goto put_parent;
> -               if (!d_same_name(entry, dir, name)) {
> -                       end_removing(entry);
> -                       entry = NULL;
> +               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);

s/entry/child/ for the above two lines

Otherwise looks good and tests OK.

Agree about the need for comments.

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.