Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp815899rdg; Thu, 10 Aug 2023 23:56:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHWY67lvAGVynjV4QGWV9phDPIODrPKFc/r76UFGE/LntS2/Fla5plgy1PuGu7BhqELj3AX X-Received: by 2002:a05:6a21:2799:b0:132:a85f:b20c with SMTP id rn25-20020a056a21279900b00132a85fb20cmr1303120pzb.38.1691736984439; Thu, 10 Aug 2023 23:56:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691736984; cv=none; d=google.com; s=arc-20160816; b=MCFEG5pSbDhK05641U0194VDuUo+CjazJqiJN8H+UsA54lJNrRGoWjn2MtlGMBFFdS YwIDDyuqe1EevKcGgCK1CzxQcWuDEXdAZxgGWByGS3tNr2Xnl5+wEhul9R0GGvfAPlH0 IpR00y7IAUVJsG2u79WKoSWd54LqLNW5rX1QBVRjbwIIk78Rx9Q5SGfxvxFyvTmI9e1k 9KhwHwCGcmOBirJqVsdRYqFVmPJ6Q/IWpBkenh11Z9VNbY4E9vTBk+vAF8g5tP85f2zq 3C6iEJysIgiZaBsnR5xVb5Nujt09A3FmGJaLsktuoMfHWrTT7M89tZPNaXIxjQLCZovU pyaQ== 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=BoRkuXwwnmR4Ric24HYWf0rbk2SdqTCyFvPxnE+wlSvqfxK8816JMlQMZjoVFOo72I SKYuOrHTZxdPbgmIT18owMnlYVX1FooadEHrYvsHhjwQYG263V6eGPIY4tMYqovg7q95 WoLw7A8ubQ/uCyBu8V5Qy89hhZ1zGkfvYXJtf5B1Gm2VI32QaPCHe4mbiNYAvO2Pu6iA 1Gpa+oL5R6E2WzJOS4Vb45x2Tuz+VRS3x8LbuJqcelODMdNGqqKibqkq/xwgScV1HUm2 iKaDSdb7v1kpn6V2fsYmGqdbItfNvUlULbnUN90o4R3HDiXfegx6dk1r/jZQVMI7t7tt 99PA== 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 e24-20020a633718000000b0055adb191739si3063153pga.62.2023.08.10.23.56.11; Thu, 10 Aug 2023 23:56:24 -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 S229476AbjHKGga (ORCPT + 99 others); Fri, 11 Aug 2023 02:36:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229807AbjHKGg3 (ORCPT ); Fri, 11 Aug 2023 02:36:29 -0400 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E21926A6 for ; Thu, 10 Aug 2023 23:36:28 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4RMYwS3fDDz4f3tqK for ; Fri, 11 Aug 2023 14:36:24 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.170]) by APP4 (Coremail) with SMTP id gCh0CgA3x6na1tVkKEbDAQ--.35746S7; Fri, 11 Aug 2023 14:36:25 +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 v3 03/12] jbd2: don't load superblock in jbd2_journal_check_used_features() Date: Fri, 11 Aug 2023 14:36:01 +0800 Message-Id: <20230811063610.2980059-4-yi.zhang@huaweicloud.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20230811063610.2980059-1-yi.zhang@huaweicloud.com> References: <20230811063610.2980059-1-yi.zhang@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgA3x6na1tVkKEbDAQ--.35746S7 X-Coremail-Antispam: 1UD129KBjvJXoW7ZFWkKrW7ArWDGr1xJr43Wrg_yoW8GrWUpa yfKFy8CrZYvr1UAF1ktFs5JFWY9ay0yFWUGr4kuw1vy3yUXrnIqry7tr1rtFyvyFZ7uw18 JF1kCws3Gws0qrDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUU9m14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_JrWl82xGYIkIc2 x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0 Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJw A2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq3wAS 0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2 IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0 Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCF04k20xvY0x0EwIxGrwCFx2 IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v2 6r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67 AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IY s7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr 0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0JUd8n5UUUUU= 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