[Devel,vz7,03/46] fuse: reset waiting

Submitted by Maxim Patlasov on March 25, 2017, 2:13 a.m.

Details

Message ID 149040797868.25341.4885553559138687073.stgit@maxim-thinkpad
State New
Series "fuse: add multi-threading support"
Headers show

Commit Message

Maxim Patlasov March 25, 2017, 2:13 a.m.
Backport from ml:

commit 73e0e738441b26a2dfc1ccdf1462cd1dc13c8cea
Author: Miklos Szeredi <mszeredi@suse.cz>
Date:   Wed Jul 1 16:25:56 2015 +0200

    fuse: reset waiting

    Reset req->waiting in fuse_put_request().  This is needed for correct
    accounting in fc->num_waiting for reserved requests.

    Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>

Signed-off-by: Maxim Patlasov <mpatlasov@virtuozzo.com>
---
 fs/fuse/dev.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 6022969..92ec220 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -259,8 +259,10 @@  void fuse_put_request(struct fuse_conn *fc, struct fuse_req *req)
 			spin_unlock(&fc->lock);
 		}
 
-		if (req->waiting)
+		if (req->waiting) {
 			atomic_dec(&fc->num_waiting);
+			req->waiting = 0;
+		}
 
 		if (req->stolen_file)
 			put_reserved_req(fc, req);