fuse: Check for req->ff in fuse_request_queue_background()

Submitted by Kirill Tkhai on May 6, 2019, 11:56 a.m.

Details

Message ID 155714379432.20468.590282042902380127.stgit@localhost.localdomain
State New
Series "fuse: Check for req->ff in fuse_request_queue_background()"
Headers show

Commit Message

Kirill Tkhai May 6, 2019, 11:56 a.m.
A request may have no ff assigned, and such the requests
can't be dropped immediately. E.g.:

[    9.238630]  [<ffffffffb80530d0>] fuse_request_queue_background+0x1d0/0x1e0
[    9.243064]  [<ffffffffb805312e>] fuse_request_send_background+0x4e/0xa0
[    9.247300]  [<ffffffffb8061a71>] fuse_fill_super+0x5f1/0x620
[    9.253878]  [<ffffffffb8061480>] ? fuse_iget+0x1f0/0x1f0
[    9.261936]  [<ffffffffb7ea035f>] mount_nodev+0x4f/0xb0
[    9.266502]  [<ffffffffb805fb3c>] fuse_mount+0x1c/0x90
[    9.271076]  [<ffffffffb7ea0f5a>] mount_fs+0x1a/0xc0
[    9.275472]  [<ffffffffb7ebec47>] vfs_kern_mount+0x67/0x110
[    9.282489]  [<ffffffffb7ec15e1>] do_mount+0x1b1/0xc90
[    9.290380]  [<ffffffffb7ec1350>] ? copy_mount_options+0xc0/0x170
[    9.295603]  [<ffffffffb7ec2403>] SyS_mount+0x83/0xd0
[    9.300777]  [<ffffffffb874adc8>] system_call_fastpath+0x22/0x27

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 fs/fuse/dev.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 1958c6e33d79..f9e33a504c70 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -612,7 +612,7 @@  bool fuse_request_queue_background(struct fuse_conn *fc, struct fuse_req *req)
 	}
 	__set_bit(FR_ISREPLY, &req->flags);
 	spin_lock(&fc->bg_lock);
-	if (unlikely(test_bit(FUSE_S_FAIL_IMMEDIATELY, &req->ff->ff_state)))
+	if (req->ff && unlikely(test_bit(FUSE_S_FAIL_IMMEDIATELY, &req->ff->ff_state)))
 		req->out.h.error = -EIO;
 	else if (likely(fc->connected)) {
 		fc->num_background++;