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 X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0BD1C6379D for ; Thu, 26 Nov 2020 08:17:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 87AD220DD4 for ; Thu, 26 Nov 2020 08:17:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388785AbgKZIQy (ORCPT ); Thu, 26 Nov 2020 03:16:54 -0500 Received: from verein.lst.de ([213.95.11.211]:33418 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388774AbgKZIQy (ORCPT ); Thu, 26 Nov 2020 03:16:54 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id AF45968B02; Thu, 26 Nov 2020 09:16:50 +0100 (CET) Date: Thu, 26 Nov 2020 09:16:50 +0100 From: Christoph Hellwig To: Tejun Heo Cc: Christoph Hellwig , Jens Axboe , Josef Bacik , Konrad Rzeszutek Wilk , Coly Li , Mike Snitzer , Greg Kroah-Hartman , Jan Kara , Johannes Thumshirn , dm-devel@redhat.com, Richard Weinberger , Jan Kara , linux-block@vger.kernel.org, xen-devel@lists.xenproject.org, linux-bcache@vger.kernel.org, linux-mtd@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 25/45] block: reference struct block_device from struct hd_struct Message-ID: <20201126081650.GA18807@lst.de> References: <20201124132751.3747337-1-hch@lst.de> <20201124132751.3747337-26-hch@lst.de> <20201125164515.GB1975@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Wed, Nov 25, 2020 at 03:20:23PM -0500, Tejun Heo wrote: > Agreed. It'd be nice to replace the stale comment. I've updated the comment. > > Jan added lookup_sem in commit 56c0908c855afbb to prevent a three way > > race between del_gendisk and blkdev_open due to the weird bdev vs > > gendisk lifetime rules. None of that can happen with the new lookup > > scheme. > > Understood. I think it'd be worthwhile to note that in the commit log. So after the idea of just holding a disk reference from each bdev did not work out very well I've reworked this a bit, and lookup_sem stays, but becomes global to protect the disk lookup (similar to the previous global bdev_map_lock).