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 3161AC64E75 for ; Thu, 26 Nov 2020 18:02:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BF873221F7 for ; Thu, 26 Nov 2020 18:02:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BF873221F7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1CCB56B0070; Thu, 26 Nov 2020 13:02:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 154BF6B0072; Thu, 26 Nov 2020 13:02:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 01CE36B0073; Thu, 26 Nov 2020 13:02:27 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0018.hostedemail.com [216.40.44.18]) by kanga.kvack.org (Postfix) with ESMTP id DD7B06B0070 for ; Thu, 26 Nov 2020 13:02:27 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 9DF80180AD804 for ; Thu, 26 Nov 2020 18:02:27 +0000 (UTC) X-FDA: 77527339134.06.jam12_130e1f027381 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin06.hostedemail.com (Postfix) with ESMTP id 62F8E1003FB24 for ; Thu, 26 Nov 2020 18:02:27 +0000 (UTC) X-HE-Tag: jam12_130e1f027381 X-Filterd-Recvd-Size: 1817 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf19.hostedemail.com (Postfix) with ESMTP for ; Thu, 26 Nov 2020 18:02:26 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id B348768B05; Thu, 26 Nov 2020 19:02:23 +0100 (CET) Date: Thu, 26 Nov 2020 19:02:23 +0100 From: Christoph Hellwig To: Jan Kara Cc: Christoph Hellwig , Jens Axboe , Tejun Heo , Josef Bacik , Coly Li , Mike Snitzer , Greg Kroah-Hartman , Johannes Thumshirn , dm-devel@redhat.com, Jan Kara , linux-block@vger.kernel.org, linux-bcache@vger.kernel.org, linux-mtd@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 36/44] block: allocate struct hd_struct as part of struct bdev_inode Message-ID: <20201126180223.GA25921@lst.de> References: <20201126130422.92945-1-hch@lst.de> <20201126130422.92945-37-hch@lst.de> <20201126173518.GV422@quack2.suse.cz> <20201126180048.GA422@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201126180048.GA422@quack2.suse.cz> User-Agent: Mutt/1.5.17 (2007-11-01) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Nov 26, 2020 at 07:00:48PM +0100, Jan Kara wrote: > > I don't think hd_struct holds a reference to block_device, does it? > > bdev_alloc() now just assigns bdev->bd_part->bdev = bdev... > > Now I understood this is probably correct - each partition (including > gendisk as 0 partition) holds the initial bdev reference and only when > corresponding kobject is getting destroyed we stop holding onto that > reference. Right? Yes.