Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp830589rwl; Thu, 10 Aug 2023 02:11:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFm5X8iVvSsRZMzYaQDzc4eqsvyOqaDGHwFxXrAZ5hKiHKKYQ4f7AX7GZHuH1DoyNA7Cxp7 X-Received: by 2002:a05:6870:2481:b0:1bb:867e:caeb with SMTP id s1-20020a056870248100b001bb867ecaebmr1954769oaq.51.1691658688197; Thu, 10 Aug 2023 02:11:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691658688; cv=none; d=google.com; s=arc-20160816; b=XQMoOTIJBtpek/f6KfZBXgaSxdXxJ1TsS7nWfJdCWiL0lVQwd4iFZelhtMYbhw/OV9 1JeGky3iL0j0rLKrrU7M7Ga5ET7qd9vIAAlaKtXVXfKwO1SNAvQ5R3yLSZcO+Ch3Wn4v Fmkv0/gaQmMmfIPEwGjxNCoAwfIWl8QuZ9XSoolJhwXda4GR05YydjvgMhatqVyyX3bd 9PRRHV//sOpXPTvbb/x8XQI3mnnxkIWS0sxUMJzmtgqEoRHFvQpjxHU/1WG6DTSGLbP1 aAihpbGyy1qNuYy0khhDz8KJTbjtP1CCnqR81cQNjLoMI/9+2Vuly3Fdx+ZanuJE5BmS s/RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=0rfmPZ6ArKGai4jL9wm/uS9Rzu6xl/0IXicIjWkquFo=; fh=fTSaBofNXp03thGUSjn2fCTzw7oFshHI80Fe6i8kpiM=; b=Ym32bEc9bzisUEkKWQoLtg1f25dRBJOGd4WPSwTsgGH0cp4XGxqtQPANcZ6ZrROwcT vvQzw4rAb60TFZ1+Rh3CKOFzGhmLktbMm/KzPBiwbgGR/VivcU5xYZHCtTbUAkeHy87C RcRYQsronKN+dF1srIqjC/6eyaQhsSX6koiQMcM9FOOL4nRQ2IY9399ri7UKxHplQd0w OTxxqIRUBr3pBi3LytfKyjL7rmtbXYD8z6jNsZHLn1EOjHHSWXzn2C5Bv2aEuVpbOatC qOV4M7zG1eGMyyqUKYrn7s83Hyh3CIH9mLi+q0gTdAOAEilxvhuZWxuYTZSEJ+/XD7BL JjjA== 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 b26-20020a6567da000000b00563eda6a8e5si1224517pgs.235.2023.08.10.02.11.13; Thu, 10 Aug 2023 02:11:28 -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 S230019AbjHJIyf (ORCPT + 99 others); Thu, 10 Aug 2023 04:54:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231659AbjHJIyf (ORCPT ); Thu, 10 Aug 2023 04:54:35 -0400 Received: from dggsgout12.his.huawei.com (dggsgout12.his.huawei.com [45.249.212.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4CAF212A for ; Thu, 10 Aug 2023 01:54:34 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4RM12D2Hbnz4f3jHs for ; Thu, 10 Aug 2023 16:54:28 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.170]) by APP4 (Coremail) with SMTP id gCh0CgD3hqm6pdRkGjJ7AQ--.1500S7; Thu, 10 Aug 2023 16:54:31 +0800 (CST) From: Zhang Yi To: linux-ext4@vger.kernel.org Cc: tytso@mit.edu, adilger.kernel@dilger.ca, jack@suse.cz, yi.zhang@huawei.com, yi.zhang@huaweicloud.com, yukuai3@huawei.com Subject: [PATCH v2 03/12] jbd2: don't load superblock in jbd2_journal_check_used_features() Date: Thu, 10 Aug 2023 16:54:08 +0800 Message-Id: <20230810085417.1501293-4-yi.zhang@huaweicloud.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20230810085417.1501293-1-yi.zhang@huaweicloud.com> References: <20230810085417.1501293-1-yi.zhang@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgD3hqm6pdRkGjJ7AQ--.1500S7 X-Coremail-Antispam: 1UD129KBjvJXoW7ZFWkKrW7ArWDGr1xJr43Wrg_yoW8GrWUpa yfKFy8CrZYvr1UAF1ktFs5JFWY9ay0yFWUGr4kuw1vy3yUXrnIqry7tr1rtFyvyFZ7uw18 JF1kCws3Gws0qrDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUU9m14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_JrWl82xGYIkIc2 x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0 Y4vE2Ix0cI8IcVAFwI0_tr0E3s1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJw A2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq3wAS 0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2 IY67AKxVWUGVWUXwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0 Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCF04k20xvY0x0EwIxGrwCFx2 IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v2 6r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67 AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IY s7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr 0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0JUCXdbUUUUU= X-CM-SenderInfo: d1lo6xhdqjqx5xdzvxpfor3voofrz/ X-CFilter-Loop: Reflected 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 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 Reviewed-by: Jan Kara --- 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.34.3