Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp27706057rwd; Tue, 4 Jul 2023 06:49:14 -0700 (PDT) X-Google-Smtp-Source: APBJJlErpXnblU+h7nslHiICABCdSNP/7jSlYwZRL+B9TRa3KZAFusVerlaA/9StO7P7fofJk9Y1 X-Received: by 2002:a17:902:e989:b0:1b6:b44d:a5b6 with SMTP id f9-20020a170902e98900b001b6b44da5b6mr9444676plb.14.1688478554501; Tue, 04 Jul 2023 06:49:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688478554; cv=none; d=google.com; s=arc-20160816; b=KZYQa5Mxr4Szz8zNzf6qcbDQOO2b5LypphzvDZMZfnwTRL5NPfUXNvhgQUVPCNh9K+ nKNAcNnyv3f+BD4/iRZfNk1/Kn7xpu+VOFh5KceoEYYdY3rHMJpqYt8Hk/PAeo0b63AA 1r+JxyzQnyvVPE4syem42xm3VieN/lRCxpjzYA0q78eQELGswT7U0sMux/Wv1wpAZ4qb 8nKB1W0bL3FQ32ZiNnwtA5maNaHTsNoTL8PjRT+f+Eo3UewmIqTkQ6nKqO4pEulZ0pWR P0RI/JHg4cO7L3JI0Mk1zziQ0YKuP+83/Tb1bSNGm8wkrE+BqeT+GkrKfEFPk/evcajG TsRg== 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=ctpni/FBb/rbnqC8o2J1sXPlHWb0L5KyNJWZsWBbiGg=; fh=Uq/HK0tePPZ4uFSrjmAoQ+8fm8HBRKIYZPcFTEYnhm4=; b=xQYKvUJzpzCYLBL5DYWRyaR3/iZOJwG0jiBtXeoXFbPS4w2z6q699Eg17DCBtpcOQt yxFhU6o1fIhq0twDNn5mvK466BTLehGEuhH4GERildL8nJeUiTdak6gpgh3Blni9bXVz 3iXlirPb7qdQdHuveh8cgevloSqbgo8E2t0+jkNcKvqfmYY4DcxTvfa1IjdZd0uCfj6f YTUkGGN/MB7a+H1YIS/MFoPtEI+Zn6142M0hZEjQ2evMny6OzpbPY9ElwJNa1WxtftJI SNkHEipraOb4pXuKpgvRUylvXrf8BcUDvksnFcyUAkuSO5tAcGCi3hPmMeFUkpZJzajr 5sBQ== 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 p3-20020a170902e74300b001b8a389459fsi2332507plf.383.2023.07.04.06.49.00; Tue, 04 Jul 2023 06:49:14 -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 S231620AbjGDNoI (ORCPT + 99 others); Tue, 4 Jul 2023 09:44:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229994AbjGDNoG (ORCPT ); Tue, 4 Jul 2023 09:44:06 -0400 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 407D3EE for ; Tue, 4 Jul 2023 06:44:05 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4QwPCN3l2Nz4f3rB3 for ; Tue, 4 Jul 2023 21:44:00 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.67]) by APP4 (Coremail) with SMTP id gCh0CgD3rLASIqRk9WjENA--.31120S7; Tue, 04 Jul 2023 21:44:01 +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, chengzhihao1@huawei.com, yukuai3@huawei.com Subject: [PATCH 03/12] jbd2: don't load superblock in jbd2_journal_check_used_features() Date: Tue, 4 Jul 2023 21:42:24 +0800 Message-Id: <20230704134233.110812-4-yi.zhang@huaweicloud.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230704134233.110812-1-yi.zhang@huaweicloud.com> References: <20230704134233.110812-1-yi.zhang@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgD3rLASIqRk9WjENA--.31120S7 X-Coremail-Antispam: 1UD129KBjvJXoW7ZFWkKrW7ArWDGr1xJr43Wrg_yoW8Jw4fpa yfKFy8CrZYvr1UAF1ktFs5JFWY9ay0yFWUGr4kCw1vy3yUXrnIqry7tr1rJFyvyFZ7uw18 JF1kG393Gws0qrDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUU9m14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_JrWl82xGYIkIc2 x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0 Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJw A2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq3wAS 0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2 IY67AKxVWUXVWUAwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0 Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCF04k20xvY0x0EwIxGrwCFx2 IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v2 6r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67 AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IY s7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr 0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0JULtxhUUUUU= X-CM-SenderInfo: d1lo6xhdqjqx5xdzvxpfor3voofrz/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,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 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 --- 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