]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
fix up queue-4.4/fuse-release-pipe-buf-after-last-use.patch
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 Nov 2021 12:08:58 +0000 (13:08 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 Nov 2021 12:08:58 +0000 (13:08 +0100)
queue-4.4/fuse-release-pipe-buf-after-last-use.patch

index 869f1bd7a9e7a80e0cd789dabe3131c31c2b7a6a..a64bb82027e7b9d62dceed04ca49d4f2db7d3c71 100644 (file)
@@ -25,9 +25,9 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 
 --- a/fs/fuse/dev.c
 +++ b/fs/fuse/dev.c
-@@ -903,6 +903,11 @@ static int fuse_try_move_page(struct fus
-       if (fuse_check_page(newpage) != 0)
-               goto out_fallback_unlock;
+@@ -922,6 +922,11 @@ static int fuse_try_move_page(struct fus
+               return err;
+       }
  
 +      page_cache_get(newpage);
 +
@@ -35,8 +35,8 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 +              lru_cache_add_file(newpage);
 +
        /*
-        * This is a new and locked page, it shouldn't be mapped or
-        * have any special flags on it
+        * Release while we have extra ref on stolen page.  Otherwise
+        * anon_pipe_buf_release() might think the page can be reused.
 @@ -929,11 +934,6 @@ static int fuse_try_move_page(struct fus
        buf->ops->release(cs->pipe, buf);
        buf->ops = NULL;