From: Maxim Patlasov Date: Wed, 2 Oct 2013 17:38:54 +0000 (+0400) Subject: fuse: writepages: protect secondary requests from fuse file release X-Git-Tag: firefly_0821_release~176^2~4998^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ce128de6260f86a990ed44a697f26d0859684f28;p=firefly-linux-kernel-4.4.55.git fuse: writepages: protect secondary requests from fuse file release 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 Signed-off-by: Miklos Szeredi --- diff --git a/fs/fuse/file.c b/fs/fuse/file.c index e6fdd59a7906..7e70506297bc 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -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); /*