Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6975CC636D6 for ; Fri, 10 Feb 2023 02:57:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230475AbjBJC5K (ORCPT ); Thu, 9 Feb 2023 21:57:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229627AbjBJC5F (ORCPT ); Thu, 9 Feb 2023 21:57:05 -0500 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACCB6658CD; Thu, 9 Feb 2023 18:57:03 -0800 (PST) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4PCdgG5pfCz4f3jHb; Fri, 10 Feb 2023 10:56:58 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.127.227]) by APP3 (Coremail) with SMTP id _Ch0CgCHgR96suVjIkgqDA--.35208S5; Fri, 10 Feb 2023 10:57:00 +0800 (CST) From: Ye Bin To: tytso@mit.edu, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org Cc: linux-kernel@vger.kernel.org, jack@suse.cz, Ye Bin Subject: [PATCH v2 1/6] jbd2: introduce callback for recovery journal Date: Fri, 10 Feb 2023 11:20:39 +0800 Message-Id: <20230210032044.146115-2-yebin@huaweicloud.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230210032044.146115-1-yebin@huaweicloud.com> References: <20230210032044.146115-1-yebin@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: _Ch0CgCHgR96suVjIkgqDA--.35208S5 X-Coremail-Antispam: 1UD129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0bp/ X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ye Bin EXT4 file system's super block may submited by journal, however it maybe submited directly when do error handle and also other scene. So super block isn't uptodate in journal. So there is need to do some extra handle when recover journal. Signed-off-by: Ye Bin --- include/linux/jbd2.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index 5962072a4b19..ab0e1a435a50 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h @@ -1308,6 +1308,17 @@ struct journal_s struct buffer_head *bh, enum passtype pass, int off, tid_t expected_commit_id); + /* + * EXT4 file system's super block may submited by journal, however it + * maybe submited directly when do error handle. So super block isn't + * uptodate in journal. So there is need to do some extra handle when + * recover journal. + */ + void *j_replay_private_data; + int (*j_replay_prepare_callback)(struct journal_s *journal); + int (*j_replay_callback)(struct journal_s *journal, + struct buffer_head *bh); + void (*j_replay_end_callback)(struct journal_s *journal); }; #define jbd2_might_wait_for_commit(j) \ -- 2.31.1