Messages in this thread | | | Date | Fri, 3 Mar 2023 19:47:26 +0100 | Subject | Re: [RFC PATCH 4/9] fuse: handle stale inode connection in fuse_queue_forget | From | Bernd Schubert <> |
| |
On 2/20/23 20:37, Alexander Mikhalitsyn wrote: > We don't want to send FUSE_FORGET request to the new > fuse daemon if inode was lookuped by the old fuse daemon > because it can confuse and break userspace (libfuse). > > For now, just add a new argument to fuse_queue_forget and > handle it. Adjust all callers to match the old behaviour. > > Cc: Miklos Szeredi <mszeredi@redhat.com> > Cc: Al Viro <viro@zeniv.linux.org.uk> > Cc: Amir Goldstein <amir73il@gmail.com> > Cc: Stéphane Graber <stgraber@ubuntu.com> > Cc: Seth Forshee <sforshee@kernel.org> > Cc: Christian Brauner <brauner@kernel.org> > Cc: Andrei Vagin <avagin@gmail.com> > Cc: Pavel Tikhomirov <ptikhomirov@virtuozzo.com> > Cc: linux-fsdevel@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Cc: criu@openvz.org > Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com> > --- > fs/fuse/dev.c | 4 ++-- > fs/fuse/dir.c | 8 ++++---- > fs/fuse/fuse_i.h | 2 +- > fs/fuse/inode.c | 2 +- > 4 files changed, 8 insertions(+), 8 deletions(-) > > diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c > index eb4f88e3dc97..85f69629f34d 100644 > --- a/fs/fuse/dev.c > +++ b/fs/fuse/dev.c > @@ -234,7 +234,7 @@ __releases(fiq->lock) > } > > void fuse_queue_forget(struct fuse_conn *fc, struct fuse_forget_link *forget, > - u64 nodeid, u64 nlookup) > + u64 nodeid, u64 nlookup, bool stale_inode_conn) > { > struct fuse_iqueue *fiq = &fc->iq; > > @@ -242,7 +242,7 @@ void fuse_queue_forget(struct fuse_conn *fc, struct fuse_forget_link *forget, > forget->forget_one.nlookup = nlookup; > > spin_lock(&fiq->lock); > - if (fiq->connected) { > + if (fiq->connected && !stale_inode_conn) { > fiq->forget_list_tail->next = forget; > fiq->forget_list_tail = forget; > fiq->ops->wake_forget_and_unlock(fiq);
I'm not sure about kernel coding rules here - for me that is unlikely rare event - I would have added unlikely() here.
| |