fuse: add missing FR_FORCE
authorMiklos Szeredi <mszeredi@redhat.com>
Wed, 22 Feb 2017 19:08:25 +0000 (20:08 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 12 Mar 2017 05:37:28 +0000 (06:37 +0100)
commit 2e38bea99a80eab408adee27f873a188d57b76cb upstream.

fuse_file_put() was missing the "force" flag for the RELEASE request when
sending synchronously (fuseblk).

If this flag is not set, then a sync request may be interrupted before it
is dequeued by the userspace filesystem.  In this case the OPEN won't be
balanced with a RELEASE.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Fixes: 5a18ec176c93 ("fuse: fix hang of single threaded fuseblk filesystem")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/fuse/file.c

index 8821c380a71aad47a6f04977afe62a724581ec6c..11538a8be9f05b2859a261c2302c38733571dcf8 100644 (file)
@@ -100,6 +100,7 @@ static void fuse_file_put(struct fuse_file *ff, bool sync)
                        iput(req->misc.release.inode);
                        fuse_put_request(ff->fc, req);
                } else if (sync) {
+                       __set_bit(FR_FORCE, &req->flags);
                        __clear_bit(FR_BACKGROUND, &req->flags);
                        fuse_request_send(ff->fc, req);
                        iput(req->misc.release.inode);