fuse: writepages: protect secondary requests from fuse file release
authorMaxim Patlasov <MPatlasov@parallels.com>
Wed, 2 Oct 2013 17:38:54 +0000 (21:38 +0400)
committerMiklos Szeredi <mszeredi@suse.cz>
Tue, 5 Nov 2013 09:11:29 +0000 (10:11 +0100)
All async fuse requests must be supplied with extra reference to a fuse
file.  This is necessary to ensure that the fuse file is not released until
all in-flight requests are completed.  Fuse secondary writeback requests
must obey this rule as well.

Signed-off-by: Maxim Patlasov <MPatlasov@parallels.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
fs/fuse/file.c

index e6fdd59..7e70506 100644 (file)
@@ -1505,6 +1505,7 @@ static void fuse_writepage_end(struct fuse_conn *fc, struct fuse_req *req)
                struct fuse_req *next = req->misc.write.next;
                req->misc.write.next = next->misc.write.next;
                next->misc.write.next = NULL;
+               next->ff = fuse_file_get(req->ff);
                list_add(&next->writepages_entry, &fi->writepages);
 
                /*