archive mirror
 help / color / mirror / Atom feed
From: Kirill Tkhai <>
Subject: [PATCH 2/2] fuse: Move clear_bit() up in request_end()
Date: Tue, 31 Jul 2018 13:25:35 +0300	[thread overview]
Message-ID: <153303273523.387.7541221195413649436.stgit@localhost.localdomain> (raw)
In-Reply-To: <153303268481.387.10809229593975235816.stgit@localhost.localdomain>

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 <>
 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 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;

  parent reply	other threads:[~2018-07-31 12:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-31 10:25 [PATCH 0/2] fuse: Small cleanup series Kirill Tkhai
2018-07-31 10:25 ` [PATCH 1/2] fuse: Use list_first_entry() in flush_bg_queue() Kirill Tkhai
2018-08-07 12:26   ` Miklos Szeredi
2018-07-31 10:25 ` Kirill Tkhai [this message]
2018-08-07 12:22   ` [PATCH 2/2] fuse: Move clear_bit() up in request_end() Miklos Szeredi
2018-08-07 12:32     ` Kirill Tkhai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=153303273523.387.7541221195413649436.stgit@localhost.localdomain \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).