[Devel] [PATCH RHEL7 COMMIT] fuse: fix ->end() vs ->waitq ordering

Konstantin Khorenko khorenko at virtuozzo.com
Mon Feb 19 14:06:59 MSK 2018


The commit is pushed to "branch-rh7-3.10.0-693.17.1.vz7.45.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-693.17.1.vz7.43.7
------>
commit ad0ba9881818baae707c42471c8a13ce9449fefd
Author: Dmitry Monakhov <dmonakhov at openvz.org>
Date:   Mon Feb 19 14:06:59 2018 +0300

    fuse: fix ->end() vs ->waitq ordering
    
    Currently waiter notified about request completion before ->eio()
    which result in race betweel synchronious waiter and ->eio() callback.
    Luckily  there are no synchronous requests which define such callback.
    So this patch should not affect existing callers.
    
    https://jira.sw.ru/browse/PSBM-80680
    Signed-off-by: Dmitry Monakhov <dmonakhov at openvz.org>
---
 fs/fuse/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 9e77e198de60..a4ea60370586 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -394,9 +394,9 @@ static void request_end(struct fuse_conn *fc, struct fuse_req *req)
 		flush_bg_queue(fc, fiq);
 		spin_unlock(&fc->lock);
 	}
-	wake_up(&req->waitq);
 	if (req->end)
 		req->end(fc, req);
+	wake_up(&req->waitq);
 	fuse_put_request(fc, req);
 }
 


More information about the Devel mailing list