
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IBEQJ3 -------------------------------- This reverts commit ffb6844e28ef6b9d76bee378774d7afbc3db6da9. We are about to revert 95257987a638 ("ext4: drop EXT4_MF_FS_ABORTED flag"), therefore the changes to the sb_rdonly check are being reverted here. Fixes: ffb6844e28ef ("ext4: drop read-only check in ext4_init_inode_table()") Signed-off-by: Baokun Li <libaokun1@huawei.com> --- fs/ext4/ialloc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index d6440dffe02b..182252546f87 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c @@ -1533,6 +1533,12 @@ int ext4_init_inode_table(struct super_block *sb, ext4_group_t group, int num, ret = 0, used_blks = 0; unsigned long used_inos = 0; + /* This should not happen, but just to be sure check this */ + if (sb_rdonly(sb)) { + ret = 1; + goto out; + } + gdp = ext4_get_group_desc(sb, group, &group_desc_bh); if (!gdp || !grp) goto out; -- 2.46.1