From patchwork Tue Jul 31 10:25:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10550599 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A739014E0 for ; Tue, 31 Jul 2018 10:25:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F4A82A4B2 for ; Tue, 31 Jul 2018 10:25:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 82A772A4C3; Tue, 31 Jul 2018 10:25:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F144A2A4B2 for ; Tue, 31 Jul 2018 10:25:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731383AbeGaMFU (ORCPT ); Tue, 31 Jul 2018 08:05:20 -0400 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=G30o8RDpKGoI9zWPlvwHTDFaFafrCTLqiPwzWWktkTM=; b=QPJOUYe+7Ls2y8TSQDbPEnvq3Z/qy1NbO4TOaPpzej0SOdJWx9APLJy/IVslMEPGdVImVbjdiLfN11NGcZR71cXlPM3gAjM3RI4YDbMXACbw9MJcjWI3fPyWDuaHMFSYjLvVyNYTJmk8tDhqcof7/WR4RTqUQ2CqItDa9O4TZLE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Received: from localhost.localdomain (185.231.240.5) by HE1PR0801MB2028.eurprd08.prod.outlook.com (2603:10a6:3:50::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.21; Tue, 31 Jul 2018 10:25:37 +0000 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> User-Agent: StGit/0.18 MIME-Version: 1.0 X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: VI1PR04CA0093.eurprd04.prod.outlook.com (2603:10a6:803:64::28) To HE1PR0801MB2028.eurprd08.prod.outlook.com (2603:10a6:3:50::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f43eff79-81db-4b1a-ab5a-08d5f6cff5c6 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:HE1PR0801MB2028; X-Microsoft-Exchange-Diagnostics: 1;HE1PR0801MB2028;3:N7kHHJb33TEmaSXq7Vbz6KnY+2NaQJcwvKr9sTYC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81GJuJFQs5WCsIPkjGvtjebwqhR/n0IVlaa5UBklR0BSKFgRUv4PWJubgCCV1A4T8kv8HWRJVcdwNPxw3rIRHKVHJceyubM4uEvjUtSDAah+86gYuziM1cv5V6CVXSvxAqvCziDIXrFCaepyEUBpL5i6GLkFIjF83qrLDdoMf9K4VW1TOaxWdtxihTjoUBlIvnN9f0eRDa1WL9wpMAjycuXKNzORWMjbrj4fSwKdORXlH/FAU5qIcwOa1qRPUadPnxKgWZmVNN84eHaUl2hfxEMXHdxwmNfae9IgsHn;4:aFa27wtnjQCPqqQc4Kc8fK+lQUBBhJPytt9WjxV4n8muiryJ9OzzCzI0NFRmDFKoG/K8HGYNN2NFBXvpY7xxIOSDqzOACbFsJw3wBLGb86NXjrvHca9PCO9VMVLmJGItFBzLY6DWfgU/cri1LHJeyKVQpAoyjPukaz2gsapJlbPFfz9nmigFOgZ5RcuouTbDv8aoUcLnhMBSaem6QDjVGfGPGeAvlz6haCajN/tN7nL8JGVIcD6VwZTQs04LocrY3sjeinOMtVwTWQI6TnfljA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(10201501046)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016);SRVR:HE1PR0801MB2028;BCL:0;PCL:0;RULEID:;SRVR:HE1PR0801MB2028; X-Forefront-PRVS: 0750463DC9 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(136003)(366004)(376002)(346002)(396003)(39850400004)(199004)(189003)(76176011)(105586002)(33896004)(81156014)(14444005)(11346002)(97736004)(86362001)(7696005)(106356001)(58126008)(53936002)(2486003)(446003)(52116002)(26005)(25786009)(6506007)(55016002)(8936002)(9686003)(386003)(23676004)(316002)(16526019)(230700001)(186003)(47776003)(305945005)(103116003)(66066001)(68736007)(476003)(2906002)(486006)(956004)(478600001)(6116002)(7736002)(5660300001)(3846002)(81166006)(8676002)(61506002)(50466002);DIR:OUT;SFP:1102;SCL:1;SRVR:HE1PR0801MB2028;H:localhost.localdomain;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BHE1PR0801MB2028=3B23=3AS9NDk?= =?utf-8?q?rT9KdCq8o0acWI/AlYOJnGXdUw2s/MWwD1EW6eBeZNX7bx5EMU8nWnkAqrBzuhxFQ?= =?utf-8?q?GQnQUruO87V4ZiAE0oKVI6hnC11WDBb4J3IMtRaCbGUAYtXiohiSMzhE84Hy/3nCX?= =?utf-8?q?D3wb11VZHCtkhNn+eYmX1xRQQrMtCf5cwrIkVIy9NlDH6GenOXpKAdx53Wrteqa5m?= =?utf-8?q?p6tCBz2uSjIaFPy+2sycthTNjIOPFFBoZbZwVehdxH9FDRrK9kaG2NXFmqwlLqs9W?= =?utf-8?q?6fiYD+ImU9HdO1EbH9GL6MpImQ/EbIUcvTJDuUen3Vthm2Qo6/LN059vRMg26RWdi?= =?utf-8?q?M+hzGUVHVX3Vrn9UXiWj4DF2PeZXn7b9aAMyCnuZJxwJ7bM6ggjg7VMzvq41uEBvk?= =?utf-8?q?m2GshWLvCP8a8Cdp5C6VUTDIkso8Ck2Qz5htVKnrpDWOy1EZwKBIcYt8W+We7bGh0?= =?utf-8?q?UrpkcJD+QVVfephUVpIRAoEeEvceGDSpNxqVc8gG2pIlWlpzYa8Y6RP2sR2uWfAu0?= =?utf-8?q?7Se777z7fPjNhgeOTmJsod8Znt0teWwbUKeaf+7xslQjy+E4dJimmK/l84pEYKeNX?= =?utf-8?q?QavO/4w0wC0TqUo7IiHXFr9NNrnk1o9Zco3g3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KBDHgpnj3o2hi2dBEHgQxx89lVVYSoRhGmyN5mOopZROrBA4++WuW+x2usdC2Dv2y/wct0vM2EcKtGlng+8WB1Y0FxaNH+lT2NR+TjdiFoY= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2018 10:25:37.9940 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f43eff79-81db-4b1a-ab5a-08d5f6cff5c6 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB2028 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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;