[PATCH v2 4/6] ext4: remove backup for super block when recovery journal

From: Ye Bin
Date: Thu Feb 09 2023 - 21:57:20 EST


From: Ye Bin <yebin10@xxxxxxxxxx>

As previous commit "jbd2: do extra handle when do journal recovery"
already do extra handle for super block. There's no need to do in
ext4_load_journal(), so remove it.

Signed-off-by: Ye Bin <yebin10@xxxxxxxxxx>
---
fs/ext4/super.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index ea0fea04907c..d86ee5af2db9 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -5916,17 +5916,8 @@ static int ext4_load_journal(struct super_block *sb,

if (!ext4_has_feature_journal_needs_recovery(sb))
err = jbd2_journal_wipe(journal, !really_read_only);
- if (!err) {
- char *save = kmalloc(EXT4_S_ERR_LEN, GFP_KERNEL);
- if (save)
- memcpy(save, ((char *) es) +
- EXT4_S_ERR_START, EXT4_S_ERR_LEN);
+ if (!err)
err = jbd2_journal_load(journal);
- if (save)
- memcpy(((char *) es) + EXT4_S_ERR_START,
- save, EXT4_S_ERR_LEN);
- kfree(save);
- }

if (err) {
ext4_msg(sb, KERN_ERR, "error loading journal");
--
2.31.1