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 96B74C001DE for ; Sat, 5 Aug 2023 08:32:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229528AbjHEIcp (ORCPT ); Sat, 5 Aug 2023 04:32:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229501AbjHEIco (ORCPT ); Sat, 5 Aug 2023 04:32:44 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D64F53A9B; Sat, 5 Aug 2023 01:32:43 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id A2E2A68AA6; Sat, 5 Aug 2023 10:32:39 +0200 (CEST) Date: Sat, 5 Aug 2023 10:32:39 +0200 From: Christoph Hellwig To: "Darrick J. Wong" Cc: Christoph Hellwig , Al Viro , Christian Brauner , Jan Kara , Chris Mason , Josef Bacik , David Sterba , Theodore Ts'o , Andreas Dilger , Jaegeuk Kim , Chao Yu , Ryusuke Konishi , Jens Axboe , linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-nilfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-block@vger.kernel.org Subject: Re: [PATCH 11/12] xfs: drop s_umount over opening the log and RT devices Message-ID: <20230805083239.GA29780@lst.de> References: <20230802154131.2221419-1-hch@lst.de> <20230802154131.2221419-12-hch@lst.de> <20230802163219.GW11352@frogsfrogsfrogs> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230802163219.GW11352@frogsfrogsfrogs> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On Wed, Aug 02, 2023 at 09:32:19AM -0700, Darrick J. Wong wrote: > > + /* see get_tree_bdev why this is needed and safe */ > > Which part of get_tree_bdev? Is it this? > > /* > * s_umount nests inside open_mutex during > * __invalidate_device(). blkdev_put() acquires > * open_mutex and can't be called under s_umount. Drop > * s_umount temporarily. This is safe as we're > * holding an active reference. > */ > up_write(&s->s_umount); > blkdev_put(bdev, fc->fs_type); > down_write(&s->s_umount); Yes. With the refactoring earlier in the series get_tree_bdev should be trivial enough to not need a more specific reference. If you think there's a better way to refer to it I can update the comment, though. > > mp->m_logdev_targp = mp->m_ddev_targp; > > } > > > > - return 0; > > + error = 0; > > +out_unlock: > > + down_write(&sb->s_umount); > > Isn't down_write taking s_umount? I think the label should be > out_relock or something less misleading. Agreed. Christian, can you just change this in your branch, or should I send an incremental patch? 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 lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 65575EB64DD for ; Sat, 5 Aug 2023 08:33:02 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1qSCiZ-0005SG-Mi; Sat, 05 Aug 2023 08:33:00 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qSCiX-0005S9-Su for linux-f2fs-devel@lists.sourceforge.net; Sat, 05 Aug 2023 08:32:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=BCIlXluXWy5gM4p2olEUM/cLP3jDHmE1DtsIWN67gk8=; b=nAFn8t+dwrFIwrQlqcqRQLnmqF nCNMieB4mLeg1oYOelGo3ZO2+4bO74wsxSEZU2n1aVdeuGt+El+azrSmMD2DTPXKagJWRsG3npJ3w mB1ktNhcg1W+k0vEWaLw0SCTHnfmtvSwru4Yokr+SEin5JLhgabXF0fOKfBIfpjnWu8s=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=BCIlXluXWy5gM4p2olEUM/cLP3jDHmE1DtsIWN67gk8=; b=Pkj7fEz5A71cBa636GWpA2gtLC z3bObQlzUANXmX0QP8KzdBGGMcKBPbZVuIXrU1EEL5EjgoVvkRbxs76E5TrHJXmb8Bd6VVlO6KSZ+ AVfADT3ZQadho54sr7ow+3CqgtGqlfn9oP07X7d5dvhZtt9ZkKWCnt5KV9Hmcp4eSTVk=; Received: from verein.lst.de ([213.95.11.211]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1qSCiT-00019Y-L3 for linux-f2fs-devel@lists.sourceforge.net; Sat, 05 Aug 2023 08:32:58 +0000 Received: by verein.lst.de (Postfix, from userid 2407) id A2E2A68AA6; Sat, 5 Aug 2023 10:32:39 +0200 (CEST) Date: Sat, 5 Aug 2023 10:32:39 +0200 From: Christoph Hellwig To: "Darrick J. Wong" Message-ID: <20230805083239.GA29780@lst.de> References: <20230802154131.2221419-1-hch@lst.de> <20230802154131.2221419-12-hch@lst.de> <20230802163219.GW11352@frogsfrogsfrogs> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230802163219.GW11352@frogsfrogsfrogs> User-Agent: Mutt/1.5.17 (2007-11-01) X-Headers-End: 1qSCiT-00019Y-L3 Subject: Re: [f2fs-dev] [PATCH 11/12] xfs: drop s_umount over opening the log and RT devices X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jens Axboe , linux-block@vger.kernel.org, Christian Brauner , linux-f2fs-devel@lists.sourceforge.net, Jan Kara , linux-fsdevel@vger.kernel.org, Josef Bacik , Ryusuke Konishi , linux-xfs@vger.kernel.org, Chris Mason , linux-nilfs@vger.kernel.org, Andreas Dilger , Al Viro , Jaegeuk Kim , David Sterba , Theodore Ts'o , linux-ext4@vger.kernel.org, Christoph Hellwig , linux-btrfs@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On Wed, Aug 02, 2023 at 09:32:19AM -0700, Darrick J. Wong wrote: > > + /* see get_tree_bdev why this is needed and safe */ > > Which part of get_tree_bdev? Is it this? > > /* > * s_umount nests inside open_mutex during > * __invalidate_device(). blkdev_put() acquires > * open_mutex and can't be called under s_umount. Drop > * s_umount temporarily. This is safe as we're > * holding an active reference. > */ > up_write(&s->s_umount); > blkdev_put(bdev, fc->fs_type); > down_write(&s->s_umount); Yes. With the refactoring earlier in the series get_tree_bdev should be trivial enough to not need a more specific reference. If you think there's a better way to refer to it I can update the comment, though. > > mp->m_logdev_targp = mp->m_ddev_targp; > > } > > > > - return 0; > > + error = 0; > > +out_unlock: > > + down_write(&sb->s_umount); > > Isn't down_write taking s_umount? I think the label should be > out_relock or something less misleading. Agreed. Christian, can you just change this in your branch, or should I send an incremental patch? _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH 11/12] xfs: drop s_umount over opening the log and RT devices Date: Sat, 5 Aug 2023 10:32:39 +0200 Message-ID: <20230805083239.GA29780@lst.de> References: <20230802154131.2221419-1-hch@lst.de> <20230802154131.2221419-12-hch@lst.de> <20230802163219.GW11352@frogsfrogsfrogs> Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: <20230802163219.GW11352@frogsfrogsfrogs> List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: "Darrick J. Wong" Cc: Christoph Hellwig , Al Viro , Christian Brauner , Jan Kara , Chris Mason , Josef Bacik , David Sterba , Theodore Ts'o , Andreas Dilger , Jaegeuk Kim , Chao Yu , Ryusuke Konishi , Jens Axboe , linux-btrfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-ext4-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-f2fs-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, linux-nilfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-xfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-block-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On Wed, Aug 02, 2023 at 09:32:19AM -0700, Darrick J. Wong wrote: > > + /* see get_tree_bdev why this is needed and safe */ > > Which part of get_tree_bdev? Is it this? > > /* > * s_umount nests inside open_mutex during > * __invalidate_device(). blkdev_put() acquires > * open_mutex and can't be called under s_umount. Drop > * s_umount temporarily. This is safe as we're > * holding an active reference. > */ > up_write(&s->s_umount); > blkdev_put(bdev, fc->fs_type); > down_write(&s->s_umount); Yes. With the refactoring earlier in the series get_tree_bdev should be trivial enough to not need a more specific reference. If you think there's a better way to refer to it I can update the comment, though. > > mp->m_logdev_targp = mp->m_ddev_targp; > > } > > > > - return 0; > > + error = 0; > > +out_unlock: > > + down_write(&sb->s_umount); > > Isn't down_write taking s_umount? I think the label should be > out_relock or something less misleading. Agreed. Christian, can you just change this in your branch, or should I send an incremental patch?