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 718B6C41513 for ; Wed, 9 Aug 2023 16:17:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229918AbjHIQRu (ORCPT ); Wed, 9 Aug 2023 12:17:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229576AbjHIQRt (ORCPT ); Wed, 9 Aug 2023 12:17:49 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E97E19E; Wed, 9 Aug 2023 09:17:49 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id A3F316732D; Wed, 9 Aug 2023 18:17:45 +0200 (CEST) Date: Wed, 9 Aug 2023 18:17:45 +0200 From: Christoph Hellwig To: "Darrick J. Wong" Cc: Christoph Hellwig , Al Viro , Christian Brauner , Namjae Jeon , Sungjong Seo , Theodore Ts'o , Andreas Dilger , Konstantin Komarov , linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, ntfs3@lists.linux.dev, linux-xfs@vger.kernel.org Subject: Re: [PATCH 06/13] xfs: close the RT and log block devices in xfs_free_buftarg Message-ID: <20230809161745.GB2346@lst.de> References: <20230808161600.1099516-1-hch@lst.de> <20230808161600.1099516-7-hch@lst.de> <20230809154532.GT11352@frogsfrogsfrogs> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230809154532.GT11352@frogsfrogsfrogs> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org On Wed, Aug 09, 2023 at 08:45:32AM -0700, Darrick J. Wong wrote: > > blkdev_issue_flush(btp->bt_bdev); > > fs_put_dax(btp->bt_daxdev, btp->bt_mount); > > + /* the main block device is closed by kill_block_super */ > > + if (bdev != btp->bt_mount->m_super->s_bdev) > > + blkdev_put(bdev, btp->bt_mount->m_super); > > Hmm... I feel like this would be cleaner if the data dev buftarg could > get its own refcount separate from super_block.s_bdev, but I looked > through the code and couldn't identify a simple way to do that. Soo... blkdev_put doesn't really drop a refcount, it closes the device. It just happens to be misnamed, but Jan is looking into a series that will as a side effect end up with a better name for this functionality.