From patchwork Mon Aug 27 15:29:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10577369 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 B981613B8 for ; Mon, 27 Aug 2018 15:29:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A700E29694 for ; Mon, 27 Aug 2018 15:29:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B4CB2969D; Mon, 27 Aug 2018 15:29:37 +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 36BF329694 for ; Mon, 27 Aug 2018 15:29:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727226AbeH0TQl (ORCPT ); Mon, 27 Aug 2018 15:16:41 -0400 Received: from mail-db5eur01on0109.outbound.protection.outlook.com ([104.47.2.109]:51264 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727014AbeH0TQk (ORCPT ); Mon, 27 Aug 2018 15:16:40 -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=tjSTzk/e7MyfWxb2FySj0qYzgvbE/OYzrYdutB4aXqA=; b=PXYRuPZdFfIC1IWi2rF/m4JMzQdR96wPynDFluvz+zzJJ2zufNBDHYXm8UnXiG6RQpqwZdoEjtwHhQwuATE7R6VOnpcHhQP7S7Wh5Ba7/CeD3ZZaNCebZT4o6pmEmDXpx5VwQSaew0EFOefdDcvmMuZ57WBNRPk4yhOcniAlrc0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Received: from localhost.localdomain (185.231.240.5) by AM5PR0801MB2020.eurprd08.prod.outlook.com (2603:10a6:203:4b::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.17; Mon, 27 Aug 2018 15:29:32 +0000 Subject: [PATCH 3/6] fuse: Underline congestion_threshold and max_background may be read w/o fc->lock From: Kirill Tkhai To: miklos@szeredi.hu, ktkhai@virtuozzo.com, linux-fsdevel@vger.kernel.org Date: Mon, 27 Aug 2018 18:29:29 +0300 Message-ID: <153538376941.18303.12286472696863147895.stgit@localhost.localdomain> In-Reply-To: <153538208536.18303.10732945923322972743.stgit@localhost.localdomain> References: <153538208536.18303.10732945923322972743.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: AM0PR02CA0014.eurprd02.prod.outlook.com (2603:10a6:208:3e::27) To AM5PR0801MB2020.eurprd08.prod.outlook.com (2603:10a6:203:4b::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 38531c34-bf55-41c9-1444-08d60c31e31c X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:AM5PR0801MB2020; X-Microsoft-Exchange-Diagnostics: 1;AM5PR0801MB2020;3:Tt32ySTEsULWp6g41BPjie8D3+nt56tsvq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DXxojUxZb8cHwjSzFeia5GUgpAwrVLe+wFg+2W3NM8OyHQMb4VoP4nXc/HuBzok69zCvDw3IqQYfdcrt/VwATyjb8HNBgmiU49ooiKOUqhI9HInc9GjfQT/otk5cZxXoY1AvyvIDepQfYu2RzYco9bfJP0JA8Z8ymr76hOGiy1ja1UBL7mjT2YHWQjYZy8bw0RxLuc8QSq00UqsUGg2MPaMsR14cftduTwA/ws41DNEl0AyX1PSXq6FRPwld+PPEUt+cL5fu70l4BuPv2L6NCdnYNqYE2R/yF/kcugbZdEi6Msiye1SlQAKa1mT8awP;4:8yBOqliuQB0+IGOptKk0LzTCgYi37OgcwvuXPsWz9xzxQ9dBSbP+QjqGVxEjAIx1t5xY1ndKG3Jna1dZkkHSNvGz71kcEMxa7eqt/FidLqbs6WvP89jnCb6tfc5DMPpMSfcJkSKfayPK0DKAfR+IfAA6sa0d5qhJsOb3dBRXYMiGg3DUVzVNZ/3ttdvCV0ptocTaMOYkFWvrKsemXQkve0hqDpsUzr9DSKqp5sxVUF/ryTyiDftNzrkrktEamkDrpJrGAByiHZR44anSOyofYm02tam5V2ZqsZBYEea6MB+RaRKYPvbWTfySRZUqQ5hk X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(211171220733660); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(3231311)(944501410)(52105095)(93006095)(93001095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(201708071742011)(7699016);SRVR:AM5PR0801MB2020;BCL:0;PCL:0;RULEID:;SRVR:AM5PR0801MB2020; X-Forefront-PRVS: 07778E4001 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(39850400004)(136003)(396003)(376002)(346002)(366004)(199004)(189003)(105586002)(61506002)(106356001)(66066001)(50466002)(47776003)(52116002)(230700001)(6116002)(3846002)(33896004)(23676004)(2486003)(76176011)(14444005)(7696005)(5660300001)(6666003)(446003)(11346002)(476003)(2906002)(486006)(956004)(81156014)(53936002)(81166006)(8676002)(9686003)(55016002)(16526019)(186003)(7736002)(386003)(478600001)(6506007)(26005)(25786009)(305945005)(68736007)(8936002)(316002)(97736004)(58126008)(103116003)(86362001);DIR:OUT;SFP:1102;SCL:1;SRVR:AM5PR0801MB2020;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=3BAM5PR0801MB2020=3B23=3Aoay7q?= =?utf-8?q?hJB7DaPRhjhCtN/0GTJa/2h9xnxUUpXpUK1j4QtasxyXYF1huhHK4LSnst0IdVYXv?= =?utf-8?q?S4Oi0SCTRiTCCUHFUa+vBIE4KGtWbpWMt2efJ28HrDc/TTalxpnD0yxhaSnCnKWGi?= =?utf-8?q?4KCeT1DtEloAJd3TlQKzo6p11Jj6AU+ypWA/Zpn/O2kHjupqrDtrhactj2tq+NWqV?= =?utf-8?q?IB+hWV6ujikRgcWg5ZJ64URgFihahbOruwB3ft8tJVfmd1Zen9E8kjf6dzmFHkm2g?= =?utf-8?q?N09UzWCYfg1ZxQo0Tb4r2DmAUPawswu7TTsRJYLgw7sVH4uODc3Ktmkp48IyD++T/?= =?utf-8?q?Y4pupYKgGW32kGzaL0+u2QtZqQpudse/HEwVbm2yqUUcxVW+JEMYw787Bwkhyvicr?= =?utf-8?q?JF4NzHyMMLrXFKjZCWGkPS+bpTRAwuaj/LnAFv/U0oVb0tP58wvSqAaPh2xzJWWhI?= =?utf-8?q?sO8fUYefXXdGDyp6fK1ZEv5+d65j/VamQ/3bFdRcZIMJfDNndnuzbu8Jzgno/1tSr?= =?utf-8?q?ldK95nl3t/cifhla6+4lf9afKsYd+yutiA4Uo1F0CdPkPEeQ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snN/vuFST2baM04dE7CMqXYNOuBEH42EVoi4SNazMl5v5QiyNwKK+emKuXuT7QjMJKfaeJc= X-Microsoft-Exchange-Diagnostics: 1;AM5PR0801MB2020;6:SSIH7gN+kuErt3CYP4PdR36g2u8CK6GzKQJzsMov50cE3UbXrxExV5S1S6jMzS/P82olp0CIYfXsL71TQcb9nmkBUvmW5dYrE1f7JsWGk9ahq7HltjeGkWoS/Mpx5J0RVdXXxbinSCS/kqebEMMskBsrIBQuL86/x+LUr5hwWDL7VpMd3BSK229+aJbeypp3wWU5tMBv+RyHP8hL+C7U5nJU9Hmm6on7aLqRm6cY71icKaCUeUfrp0wU/MAtwRf/5jx+czwYgmCPXpJJ3lJB00CNtYqQLz2s/1GS3wP3hJrcaPXh3xn76OmoqZlHM5AYfYLz81TZf1C1Hy1eZyYizQ2F4qUmIPHoeAIJLKLujEppARssmP/nH8PiOHl2d1gsTx9we/7OFu5FWLEOMKmHgPVkXLD43JShqN5TPczRdIwvY3E0ZtyXrPrOR6GQrbWuuHRjeV/0AF38oB8pGd4WiQ==;5:LaWve3oHlQHsankoYajA7/tztYqeC4SC+1ugICnbOhrCft70xcYGVN/v3KFlb5+kDS0cmhmZP3dczZlsKqFi0YqSVAvdahPjOE/s9W5N9Z+UDZ+6LmbikaXRo8dLY7DbGEUbvlRqDG+jaZzMwti001c4DnrTyTqc0ZrVtWTbz+Q=;7:pwERL7pd1dfCrYZ+NdQk9+ZAN2KX+KkfoWDR9jL1gLLimsSqBVhORBP4ONAEJAJLYFKUgzUyCqiOPXvuSLCEUk5oFE/9Bu7aVjA2mryx2Zatr+CA+pHPp8oTKG86olz1gFsr6M7VjLpxDyRi02/DWIFTGZwS1o0o10WvE28mjpaFOWYXBO1g3XKn2eIG9G9gQ/CovuNAjDL9vuZPJGQUSzYbkFplLzm7UGcrks3RTf0K1u79B/YwutUppG1Ah0gk SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;AM5PR0801MB2020;20:k4YSEnML99Rxucd4iEmJmNBWugAMbFaBgoUtqGFbPSmSh4B/bbLbOjcuSTiY792RvHYJoAjBwJKPfZgD0Imlop6DopN1FwFonPVYGXXNYhLBckSfaYPFcajBgsV7GkBTIvWeubGY8VbKjSCA5FbxpqU1ZgU7QnZmAphNwAweS18= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2018 15:29:32.0300 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 38531c34-bf55-41c9-1444-08d60c31e31c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB2020 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 Since they are of unsigned int type, it's allowed to read them unlocked during reporting to userspace. Let's underline this fact with READ_ONCE() macroses. Signed-off-by: Kirill Tkhai --- fs/fuse/control.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/fuse/control.c b/fs/fuse/control.c index e09b9cd9c3fc..c7290625e171 100644 --- a/fs/fuse/control.c +++ b/fs/fuse/control.c @@ -107,7 +107,7 @@ static ssize_t fuse_conn_max_background_read(struct file *file, if (!fc) return 0; - val = fc->max_background; + val = READ_ONCE(fc->max_background); fuse_conn_put(fc); return fuse_conn_limit_read(file, buf, len, ppos, val); @@ -144,7 +144,7 @@ static ssize_t fuse_conn_congestion_threshold_read(struct file *file, if (!fc) return 0; - val = fc->congestion_threshold; + val = READ_ONCE(fc->congestion_threshold); fuse_conn_put(fc); return fuse_conn_limit_read(file, buf, len, ppos, val);