fuse: revalidate: don't invalidate if interrupted
authorMiklos Szeredi <mszeredi@redhat.com>
Wed, 7 Jun 2023 15:49:20 +0000 (17:49 +0200)
committerMiklos Szeredi <mszeredi@redhat.com>
Wed, 7 Jun 2023 15:49:20 +0000 (17:49 +0200)
If the LOOKUP request triggered from fuse_dentry_revalidate() is
interrupted, then the dentry will be invalidated, possibly resulting in
submounts being unmounted.

Reported-by: Xu Rongbo <xurongbo@baidu.com>
Closes: https://lore.kernel.org/all/CAJfpegswN_CJJ6C3RZiaK6rpFmNyWmXfaEpnQUJ42KCwNF5tWw@mail.gmail.com/
Fixes: 9e6268db496a ("[PATCH] FUSE - read-write operations")
Cc: <stable@vger.kernel.org>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/fuse/dir.c

index 5a4a7155cf1cd36adfa3c64c95a2ae3c1b1feb2a..f67bef9d83c4bf449fc8f29263bfb1833c820b3d 100644 (file)
@@ -258,7 +258,7 @@ static int fuse_dentry_revalidate(struct dentry *entry, unsigned int flags)
                        spin_unlock(&fi->lock);
                }
                kfree(forget);
-               if (ret == -ENOMEM)
+               if (ret == -ENOMEM || ret == -EINTR)
                        goto out;
                if (ret || fuse_invalid_attr(&outarg.attr) ||
                    fuse_stale_inode(inode, outarg.generation, &outarg.attr))