Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp27702726rwd; Tue, 4 Jul 2023 06:46:14 -0700 (PDT) X-Google-Smtp-Source: APBJJlHLmzwTeNGNadNt+2DZQk1TwevFQucwM1nOHOPoKIisxRMCuT2KduXnQrg4ro2PaAMN9kTc X-Received: by 2002:aa7:94b1:0:b0:676:8fac:37 with SMTP id a17-20020aa794b1000000b006768fac0037mr16474456pfl.4.1688478374150; Tue, 04 Jul 2023 06:46:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688478374; cv=none; d=google.com; s=arc-20160816; b=C8naXXCtwGINKT9UdNHzqd4GHrww0pe1fvg1QweoV/piDLc1UOipV6e+jRwbs8SSpi Hg2LoUQsy6EHz7DMufhcgm/A0g4Rl+byjfmbewqVedpNnrX/Ydf9yAEXpWyF9vWnr8cQ Xde1nJPFLUx8wylfCVXVNjDqZHz77yAB/D6ZelcmDQYFQoqdd0aNmx4BjgQf3jtFohF6 uPlH5OkBQlXulLDTT5bjEvmFYUq96moHsZmB+MkppJNQtmPHLp8C71yVzr9c7PPSHOl5 5pV9thl1R+700PSZqX6Uua4XbrGQGa6KnsezOgLZjcvELuJBP7gQBrH31bESTK7IpdjO AzEg== 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 :message-id:date:subject:cc:to:from; bh=Z1zCrdepie5wGigYXPXx1roHraseRE/NzNiZ1jvybj0=; fh=Uq/HK0tePPZ4uFSrjmAoQ+8fm8HBRKIYZPcFTEYnhm4=; b=u2el+8S+jWsKb2sAlxTHH6AvEJuFsrRgxwG6MKtFKk8EIY7apDsO6MqBipQP4U2ZK2 zvmrHBkWeoSiXXMB4kGw5tGv19GrcgiYS1ygDNx8WIoXxXCTS602Fyv1anQjli/+T0OX OKfKRg3MaWcUiZ0nRtX/I7vGuy2YgWVuAq9bRH3RI9ouygG/Klzh9PCX9t7UpidTHMZF hWNLEVM2IxIBhlO9qAqY09CZCmEeuToujEM8cQ1/xrlVsy/VCatQJsNZm1o4ZsaAOZKw Ak3b3DdEn3NevZMVtspJD6htS+Uwy43UYLB1rRoru8mOWQrjrJFWJB3YC9h1G5hKKnHO zdrA== 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 ct26-20020a056a000f9a00b00678243b2774si17290516pfb.78.2023.07.04.06.45.56; Tue, 04 Jul 2023 06:46: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 S231249AbjGDNoF (ORCPT + 99 others); Tue, 4 Jul 2023 09:44:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229994AbjGDNoE (ORCPT ); Tue, 4 Jul 2023 09:44:04 -0400 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 085DCEE for ; Tue, 4 Jul 2023 06:44:04 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4QwPCM2k2cz4f3lfW for ; Tue, 4 Jul 2023 21:43:59 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.67]) by APP4 (Coremail) with SMTP id gCh0CgD3rLASIqRk9WjENA--.31120S4; Tue, 04 Jul 2023 21:43:56 +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 00/12] ext4,jbd2: cleanup journal load and initialization process Date: Tue, 4 Jul 2023 21:42:21 +0800 Message-Id: <20230704134233.110812-1-yi.zhang@huaweicloud.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgD3rLASIqRk9WjENA--.31120S4 X-Coremail-Antispam: 1UD129KBjvJXoW7CF1xGw1xtF4fKr4kZr1DWrg_yoW8Ary3pF 43Ga4furWUC34xAa1IqF4xGFWfWw1Ikay7Grn7Crn7Aw4rZFnrtr48Jr1rJFyUCFW8ua12 gF4UGanxGw10k37anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUyG14x267AKxVW8JVW5JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4U JVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gc CE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E 2Ix0cI8IcVAFwI0_Jrv_JF1lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJV W8JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1l42xK82IYc2Ij64vI r41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8Gjc xK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0xvE2Ix0 cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE42xK8V AvwI8IcIk0rVWrZr1j6s0DMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7Cj xVAFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7VUbE_M3UUUUU== 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 Hello, This patch set cleanup the journal load and initialization process (discussed and suggested by Ted in [1]). Firstly, move reading of the journal superblock from jbd2_journal_load() and jbd2_journal_wipe() early to journal_init_common(), and completely drop the kludgy call of journal_get_superblock() in jbd2_journal_check_used_features(). Then cleanup the ext4_get_journal() and ext4_get_dev_journal(), making their initialization process and error handling process more clear, and return proper errno if some bad happens. Finally rename those two functions to jbd2_open_{dev,inode}_journal. This patch set has passed 'kvm-xfstests -g auto'. [1] https://lore.kernel.org/linux-ext4/20230617185057.GA343628@mit.edu/ Thanks, Yi. Zhang Yi (12): jbd2: move load_superblock() dependent functions jbd2: move load_superblock() into journal_init_common() jbd2: don't load superblock in jbd2_journal_check_used_features() jbd2: checking valid features early in journal_get_superblock() jbd2: open code jbd2_verify_csum_type() helper jbd2: cleanup load_superblock() jbd2: add fast_commit space check jbd2: cleanup journal_init_common() jbd2: drop useless error tag in jbd2_journal_wipe() jbd2: jbd2_journal_init_{dev,inode} return proper error return value ext4: cleanup ext4_get_dev_journal() and ext4_get_journal() ext4: ext4_get_{dev}_journal return proper error value fs/ext4/super.c | 154 ++++++++------- fs/jbd2/journal.c | 474 ++++++++++++++++++++++----------------------- fs/ocfs2/journal.c | 8 +- 3 files changed, 308 insertions(+), 328 deletions(-) -- 2.39.2