Message ID | 20230107032126.4165860-3-libaokun1@huawei.com |
---|---|
State | Awaiting Upstream |
Headers | show |
Series | ext4: fix possible null pointer dereference in ext4_get_group_info | expand |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 260c1b3e3ef2..3fe9dc19ff9c 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -5953,8 +5953,11 @@ static int ext4_load_journal(struct super_block *sb, if (!really_read_only && journal_devnum && journal_devnum != le32_to_cpu(es->s_journal_dev)) { es->s_journal_dev = cpu_to_le32(journal_devnum); - - /* Make sure we flush the recovery flag to disk. */ + ext4_commit_super(sb); + } + if (!really_read_only && journal_inum && + journal_inum != le32_to_cpu(es->s_journal_inum)) { + es->s_journal_inum = cpu_to_le32(journal_inum); ext4_commit_super(sb); }