]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
fuse: fix possibly missing fuse_copy_finish() call in fuse_notify()
authorMiklos Szeredi <mszeredi@redhat.com>
Mon, 1 Sep 2025 15:16:26 +0000 (17:16 +0200)
committerMiklos Szeredi <mszeredi@redhat.com>
Fri, 5 Sep 2025 07:11:16 +0000 (09:11 +0200)
In case of FUSE_NOTIFY_RESEND and FUSE_NOTIFY_INC_EPOCH fuse_copy_finish()
isn't called.

Fix by always calling fuse_copy_finish() after fuse_notify().  It's a no-op
if called a second time.

Fixes: 760eac73f9f6 ("fuse: Introduce a new notification type for resend pending requests")
Fixes: 2396356a945b ("fuse: add more control over cache invalidation behaviour")
Cc: <stable@vger.kernel.org> # v6.9
Reviewed-by: Joanne Koong <joannelkoong@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/fuse/dev.c

index df793003eb0c8751d19c3baa8a578f8080a6ec82..85d05a5e40e99f3bdd659d09c6079b8cacb079c4 100644 (file)
@@ -2178,7 +2178,7 @@ static ssize_t fuse_dev_do_write(struct fuse_dev *fud,
         */
        if (!oh.unique) {
                err = fuse_notify(fc, oh.error, nbytes - sizeof(oh), cs);
-               goto out;
+               goto copy_finish;
        }
 
        err = -EINVAL;