Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp2314557rwo; Thu, 3 Aug 2023 07:46:41 -0700 (PDT) X-Google-Smtp-Source: APBJJlFYoTTNwBHLYNOJp79+M1CDT4e6NqAMKVq17Qo7JjAF6Y7nLQUqiBqdnaV2vsFuSstpOyPo X-Received: by 2002:a05:6808:144c:b0:3a7:3b6f:ed46 with SMTP id x12-20020a056808144c00b003a73b6fed46mr14670624oiv.27.1691074001048; Thu, 03 Aug 2023 07:46:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691074001; cv=none; d=google.com; s=arc-20160816; b=f4ph3PyBzM8/aI1kqQf9a4Eb2BjwJsfRW5Ex+H9Ezg0M3zF9slHjMulNSZQv5/0mhs uWUJiAOu7yhN07ipNmJHcjF8pKYAUjVvPH1O47YfXkphPfnfz+TBP8BfHEcToJIhgFE+ u2sPvauq6Ysyl/vBuH1HAizFUaDGOupoiIv0grEyWbfQES306Wz8EnynNdoXF7PiH5oO MBRuZU1Zm5m08TIkeVwL2x7YkRfyHuAsigOGavtqEy22K0ql9Kq3AipqWxNQJ8yHMz1+ Eqid/sXAO//d8XaAckMyBUS62ra3jqPjbmQE2AXKaV9ApoWLs3S1dlW8LlXWR0ir08NA TAKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=UDPtnYSNM4hfZ7dEGKrwZaeKN847Hc2R5Tx9DTRoPVo=; fh=wuOMse76qtNuGj53rjtYpjyLfPslK5YzTYUod4PV/qk=; b=al/UJfQ1XaGCUQO1qPY8Ad5Qs0it26+giJSGUhWibtT2StXcdHkSEDoxT2pr4xftMf sL6VS/L/UMqPSJgBT8tF9q40QK9YoI5xPxEMSMYljB1GDNAdU/tohrSMIU98sDiRpweQ l0wntxB4Q9PGz7LyqfnSeWCEHGN/CG6s3LozZpmTRFybR4oGHtXYrLvBfWqkQ7ZWiO1h eG0dKzn8XDUD1T8p+b7BX4IhgshCro6d9WsfLqFoNdQiRJSyXmJW8XCM9jkY5Fgry6gc DhYNZnMUyIBoiR/fPE3Mf/L22P3rMIlViNChUAyfibwbNk01E4+wkF3oRT9sTj/6kbVk Aopg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=E7UZ1iiu; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=B5xphLHA; 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 j71-20020a63804a000000b00563f72935e3si9219025pgd.608.2023.08.03.07.46.27; Thu, 03 Aug 2023 07:46:40 -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; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=E7UZ1iiu; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=B5xphLHA; 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 S235026AbjHCN0L (ORCPT + 99 others); Thu, 3 Aug 2023 09:26:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234818AbjHCN0H (ORCPT ); Thu, 3 Aug 2023 09:26:07 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B819A1704; Thu, 3 Aug 2023 06:25:51 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 677B61F749; Thu, 3 Aug 2023 13:25:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1691069150; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=UDPtnYSNM4hfZ7dEGKrwZaeKN847Hc2R5Tx9DTRoPVo=; b=E7UZ1iiufRd6HQ+34iZcMYVFaaRe8SvsUrT0SQQvYAiV7H0ow4HMtpOSs0XFfDLsK6mofq m8IW+7BHidAqacwvDXpUtYQ/stwlGUq8qmHod1q3RRCoVv9jmLoSr02udJ08ZthhcQ8goZ YrmN6xC5D8mhbxcLHkRP7y9BvhATuBE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1691069150; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=UDPtnYSNM4hfZ7dEGKrwZaeKN847Hc2R5Tx9DTRoPVo=; b=B5xphLHA7/FHGZBWy7OlEj6b7ZdzMhzyW2fcwI1Lqy4kV7PED0c6lIhQPKoGPMxCPtcEYu 4Ivy0DuFbz5vzjCw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 57A06134B0; Thu, 3 Aug 2023 13:25:50 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id nLRfFd6qy2THbgAAMHmgww (envelope-from ); Thu, 03 Aug 2023 13:25:50 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id DDE5DA076B; Thu, 3 Aug 2023 15:25:49 +0200 (CEST) Date: Thu, 3 Aug 2023 15:25:49 +0200 From: Jan Kara To: Christoph Hellwig Cc: Al Viro , Christian Brauner , Jan Kara , Chris Mason , Josef Bacik , David Sterba , Theodore Ts'o , Andreas Dilger , Jaegeuk Kim , Chao Yu , Ryusuke Konishi , "Darrick J. Wong" , 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 09/12] ext4: drop s_umount over opening the log device Message-ID: <20230803132549.s3rz4au5adagwdtf@quack3> References: <20230802154131.2221419-1-hch@lst.de> <20230802154131.2221419-10-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230802154131.2221419-10-hch@lst.de> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 02-08-23 17:41:28, Christoph Hellwig wrote: > Just like get_tree_bdev needs to drop s_umount when opening the main > device, we need to do the same for the ext4 log device to avoid a > potential lock order reversal with s_unmount for the mark_dead path. > > It might be preferable to just drop s_umount over ->fill_super entirely, > but that will require a fairly massive audit first, so we'll do the easy > version here first. > > Signed-off-by: Christoph Hellwig Looks good. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/ext4/super.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/fs/ext4/super.c b/fs/ext4/super.c > index 193d665813b611..2ccb19d345c6dd 100644 > --- a/fs/ext4/super.c > +++ b/fs/ext4/super.c > @@ -5854,7 +5854,10 @@ static journal_t *ext4_get_dev_journal(struct super_block *sb, > if (WARN_ON_ONCE(!ext4_has_feature_journal(sb))) > return NULL; > > + /* see get_tree_bdev why this is needed and safe */ > + up_write(&sb->s_umount); > bdev = ext4_blkdev_get(j_dev, sb); > + down_write(&sb->s_umount); > if (bdev == NULL) > return NULL; > > -- > 2.39.2 > -- Jan Kara SUSE Labs, CR