diff mbox series

[2/6] fuse: Move clear_bit() up in request_end()

Message ID 153538375956.18303.16994686498035052815.stgit@localhost.localdomain (mailing list archive)
State New, archived
Headers show
Series Extract bg queue logic out fuse_conn::lock | expand

Commit Message

Kirill Tkhai Aug. 27, 2018, 3:29 p.m. UTC
Nobody can clear FR_BACKGROUND bit on processing
request in parallel, so it's possible to do it
out of fc->lock.

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

Patch

diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 214ce96b1d26..ce07a41ff8fe 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -390,8 +390,8 @@  static void request_end(struct fuse_conn *fc, struct fuse_req *req)
 	WARN_ON(test_bit(FR_PENDING, &req->flags));
 	WARN_ON(test_bit(FR_SENT, &req->flags));
 	if (test_bit(FR_BACKGROUND, &req->flags)) {
-		spin_lock(&fc->lock);
 		clear_bit(FR_BACKGROUND, &req->flags);
+		spin_lock(&fc->lock);
 		if (fc->num_background == fc->max_background)
 			fc->blocked = 0;