From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-eopbgr00117.outbound.protection.outlook.com ([40.107.0.117]:54143 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731350AbeGaMFT (ORCPT ); Tue, 31 Jul 2018 08:05:19 -0400 Subject: [PATCH 2/2] fuse: Move clear_bit() up in request_end() From: Kirill Tkhai To: miklos@szeredi.hu, linux-fsdevel@vger.kernel.org, ktkhai@virtuozzo.com Date: Tue, 31 Jul 2018 13:25:35 +0300 Message-ID: <153303273523.387.7541221195413649436.stgit@localhost.localdomain> In-Reply-To: <153303268481.387.10809229593975235816.stgit@localhost.localdomain> References: <153303268481.387.10809229593975235816.stgit@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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;