Re: PROBLEM: FUSE_NOTIFY_INVAL_ENTRY leaves stale negative dentry after c9ba789dad15
From: Miklos Szeredi
Date: Thu Jun 04 2026 - 03:24:18 EST
On Tue, 2 Jun 2026 at 01:43, NeilBrown <neilb@xxxxxxxxxxx> 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