Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp827419rwb; Sat, 5 Aug 2023 01:42:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG3ADJBuNM6RjoGFoG9FSzxNWdBt+GZax1PY2JNa3xAYXDZWmkh6zmgnYsFGPW1HL3cADeT X-Received: by 2002:a05:6358:260e:b0:139:a866:4155 with SMTP id l14-20020a056358260e00b00139a8664155mr4823553rwc.5.1691224938142; Sat, 05 Aug 2023 01:42:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691224938; cv=none; d=google.com; s=arc-20160816; b=aRCWM0NZ0Pv+KT6PH42/yUs1il/QvsEyDsgE+jAAEya0X9uDnNTq1BjkpLUWFho73g aMRDVA96wj1/FFl17kyRWNvjzxpsYBE3CUWxp+mxYWgEL0rC0UKLqTU/PfPTndBB4hfq IgXul5EABaAIYLImSvIzA0Skn28aASLDCdwIiE7yIh49vhkvARZ0oaZ3nDwpxuzM8EeY qs3RYa0tRIP/kHKU+tGs6dUXPQMfUCsYWtzjF5u4xF9DgcTbjiF/ZLrvT/cUqy6Om4i6 k9MdQpY/M+0sxhIcUf3sXCk/TSlmYaXYshTaKGU5Ko5dnIwtMHScLi9q/Zdvh9E4MEMU tCMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=BCIlXluXWy5gM4p2olEUM/cLP3jDHmE1DtsIWN67gk8=; fh=qCCbvzcuxz7MAHEoB0gDTValG28zUqkflMEoT+9E4+s=; b=VIt3i3z78bp8IuasW+x9hIv4BaMz58DAeQotzXrryTWud9BkjKlwgKdUWL/9quqqY5 dmHx/WpmiYjJy/P3XDMd74hgoYnMmvzpkUSesY/xSt+OC1+rNQxel5Qe360rgAsQNzb9 jwpPDbcwifkPH5B/h8UkkXXyfz4LDy2JHxgdL5KO1dXU7pqSaJd8Cuc1d50LfkGjG5LM m9lL0G6JukrXbfLbphZj4DDhX25dwxKNB02nv7VzACDdvkYjACrLkGye/xnJ1BlMM3cz loSLvVVQaVrOgMBpyDJAbesa83m5DX4f0OjmwhXKtTzznh8vPTBnn2DLivuSgXER3xkK Ww+w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c10-20020a170902aa4a00b001b89b1b9a01si2912891plr.194.2023.08.05.01.41.54; Sat, 05 Aug 2023 01:42:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229834AbjHEIcp (ORCPT + 99 others); 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) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@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?