From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04FA2C83F12 for ; Mon, 28 Aug 2023 12:10:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230034AbjH1MJy (ORCPT ); Mon, 28 Aug 2023 08:09:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230333AbjH1MJs (ORCPT ); Mon, 28 Aug 2023 08:09:48 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F89BA9; Mon, 28 Aug 2023 05:09:46 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id CFEA56732A; Mon, 28 Aug 2023 14:09:40 +0200 (CEST) Date: Mon, 28 Aug 2023 14:09:40 +0200 From: Christoph Hellwig To: Al Viro Cc: Christoph Hellwig , Jens Axboe , Richard Weinberger , Josef Bacik , "Md. Haris Iqbal" , Jack Wang , Phillip Potter , Coly Li , Miquel Raynal , Vignesh Raghavendra , "Martin K. Petersen" , Chris Mason , David Sterba , Christian Brauner , "Rafael J. Wysocki" , Pavel Machek , dm-devel@redhat.com, linux-block@vger.kernel.org, linux-um@lists.infradead.org, linux-scsi@vger.kernel.org, linux-bcache@vger.kernel.org, linux-mtd@lists.infradead.org, linux-nvme@lists.infradead.org, linux-btrfs@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-nilfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-pm@vger.kernel.org, Hannes Reinecke Subject: Re: [PATCH 01/30] block: also call ->open for incremental partition opens Message-ID: <20230828120940.GB10552@lst.de> References: <20230608110258.189493-1-hch@lst.de> <20230608110258.189493-2-hch@lst.de> <20230825024457.GD95084@ZenIV> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230825024457.GD95084@ZenIV> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Fri, Aug 25, 2023 at 03:44:57AM +0100, Al Viro wrote: > That got me curious about the ->bd_openers - do we need it atomic? > Most of the users (and all places that do modifications) are > under ->open_mutex; the only exceptions are > * early sync logics in blkdev_put(); it's explicitly racy - > see the comment there. > * callers of disk_openers() in loop and nbd (the ones in > zram are under ->open_mutex). There's driver-private exclusion > around those, but in any case - READ_ONCE() is no worse than > atomic_read() in those cases. > > Is there something subtle I'm missing here? No. When I had to add unlocked readers I did the READ_ONCE initially, but reviewers though the atomic_t would be better. I didn't really feel like arguing so went with this version.