Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp2288414rwo; Thu, 3 Aug 2023 07:25:05 -0700 (PDT) X-Google-Smtp-Source: APBJJlFejlVSKTl2B6r13ezFXB7znk3lsKE9w9lMlTiQhaqTHFekZIiGvhPHlcm1cZA/n+wBG0Nc X-Received: by 2002:a17:902:e744:b0:1b2:5d5b:e871 with SMTP id p4-20020a170902e74400b001b25d5be871mr19538164plf.59.1691072705255; Thu, 03 Aug 2023 07:25:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691072705; cv=none; d=google.com; s=arc-20160816; b=iWsKXd393cjOVWVIMJpDxZ638yRMXQZdWugMT3OBSDuuSKe1ZPZV34bZ+AsCSU6V+H QJrCx2KQZJWD8g+wEqGNQqBv025oPbb4DwuNdZdDkkN5wimGoYs6jxPMg5XLTh9yYFEy SauinRFFNZLfRfZtFdS9wO4Cf8Y8bjRiCworXl0hI9J/tUDtuxKQ5AJoc79xgF1AuwxK kDLBmgyk1S71ftC81U/AlEJ6ADYV/sTaQcmuSkuXarCU6zPuZ232atv4wk7o8GzukhRy fQvpPNj9hH6VY5w44F3xZ5XnGlhSyexpsO8AN8JGh0PqbfyrEVkeF+zgHhLJj72Di0/+ JFdA== 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=8Vvsf/cP6XtXX3T8+N+tbMjuIiHy5xSPVgqEW/dHUJw=; fh=2Cn0oHhRunYO+MqeElF523wQvgmjxkSAMpH3Se99YF8=; b=DEKV+ACGtTzhOe+js1mtRxMRPnmTHlfV7kvSTE7ynVLJofWOgvx6QX+bhmakLKDe/R A5cTUEySwnqhN0yCBo7el6hVRo5Vms2t6ume/7GxJj1G+nYOEsF3mV4Hav72DJ0NDXII 4SQlvYeW24J5mSuesThMzsYqMGu1Ethb0Uw7BlsUHDwEwsD7/1RMq75U4qvJ42yTlj09 Tog4QuqZhkUxyab46Z01nvvARlBdJLEJJWE7XCdqFD+vvzjKLBswej0zdc31nCJBxQGD a0Q3ABLJI8VtqlfWPIxH6LeHi78jwfBFDnTmaBn/8fankprvncoJtEOYIuVHuEDyFv64 5wgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=OZ6eFM9F; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=ZnKw5C0s; 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 v1-20020a170902d08100b001b9e9b21280si1048209plv.592.2023.08.03.07.24.51; Thu, 03 Aug 2023 07:25:05 -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=OZ6eFM9F; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=ZnKw5C0s; 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 S235038AbjHCOPZ (ORCPT + 99 others); Thu, 3 Aug 2023 10:15:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235630AbjHCOPH (ORCPT ); Thu, 3 Aug 2023 10:15:07 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 163FA44BD for ; Thu, 3 Aug 2023 07:14:46 -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-out1.suse.de (Postfix) with ESMTPS id 9E27C21985; Thu, 3 Aug 2023 14:14:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1691072084; 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=8Vvsf/cP6XtXX3T8+N+tbMjuIiHy5xSPVgqEW/dHUJw=; b=OZ6eFM9FGMwe1opOctFlOuMfjyksdw9mCWD3yO78Uurua+Rn0KAruk/tYGiMfhHy64gu7r NNPWcW5SEBklAIX7urn8iC6EdZIFxYnvS08ZIHCwloDjFX8l1Ne54UcBlbizoaPX0vr88U K5nLj3Lv0Hp0cN4y20eIscSRRaKrsl8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1691072084; 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=8Vvsf/cP6XtXX3T8+N+tbMjuIiHy5xSPVgqEW/dHUJw=; b=ZnKw5C0sTLL4nC5EFSL62Ya0GFspEJCE+LxWawtkVL7eVYMceXgC3LD3WEiWS5y492TtRw aurTNEox7FBW7wBg== 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 8F3281333C; Thu, 3 Aug 2023 14:14:44 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id vC70IlS2y2TyCQAAMHmgww (envelope-from ); Thu, 03 Aug 2023 14:14:44 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 2C1FCA076B; Thu, 3 Aug 2023 16:14:44 +0200 (CEST) Date: Thu, 3 Aug 2023 16:14:44 +0200 From: Jan Kara To: Zhang Yi Cc: linux-ext4@vger.kernel.org, tytso@mit.edu, adilger.kernel@dilger.ca, jack@suse.cz, yi.zhang@huawei.com, chengzhihao1@huawei.com, yukuai3@huawei.com Subject: Re: [PATCH 03/12] jbd2: don't load superblock in jbd2_journal_check_used_features() Message-ID: <20230803141444.eovm5swjewaepela@quack3> References: <20230704134233.110812-1-yi.zhang@huaweicloud.com> <20230704134233.110812-4-yi.zhang@huaweicloud.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230704134233.110812-4-yi.zhang@huaweicloud.com> 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 Tue 04-07-23 21:42:24, Zhang Yi wrote: > From: Zhang Yi > > Since load_superblock() has been moved to journal_init_common(), the > in-memory superblock structure is initialized and contains valid data > once the file system has a journal_t object, so it's safe to access it, > let's drop the call to journal_get_superblock() from > jbd2_journal_check_used_features() and also drop the setting/clearing of > the veirfy bit of the superblock buffer. > > Signed-off-by: Zhang Yi Looks good. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/jbd2/journal.c | 5 ----- > 1 file changed, 5 deletions(-) > > diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c > index b247d374e7a6..c7cdb434966f 100644 > --- a/fs/jbd2/journal.c > +++ b/fs/jbd2/journal.c > @@ -1361,8 +1361,6 @@ static int journal_get_superblock(journal_t *journal) > bh = journal->j_sb_buffer; > > J_ASSERT(bh != NULL); > - if (buffer_verified(bh)) > - return 0; > > err = bh_read(bh, 0); > if (err < 0) { > @@ -1437,7 +1435,6 @@ static int journal_get_superblock(journal_t *journal) > goto out; > } > } > - set_buffer_verified(bh); > return 0; > > out: > @@ -2224,8 +2221,6 @@ int jbd2_journal_check_used_features(journal_t *journal, unsigned long compat, > > if (!compat && !ro && !incompat) > return 1; > - if (journal_get_superblock(journal)) > - return 0; > if (!jbd2_format_support_feature(journal)) > return 0; > > -- > 2.39.2 > -- Jan Kara SUSE Labs, CR