[PATCH] ext4: stop overwrite the errcode in ext4_setup_super

From: yangerkun <yangerkun@huawei.com> hulk inclusion category: bugfix bugzilla: 35487 CVE: NA ----------------------------------------------- Now the errcode from ext4_commit_super will overwrite EROFS exists in ext4_setup_super. Actually, no need to call ext4_commit_super since we will return EROFS. Fix it by goto done directly. Fixes: c89128a00838 ("ext4: handle errors on ext4_commit_super") Signed-off-by: yangerkun <yangerkun@huawei.com> Reviewed-by: zhangyi (F) <yi.zhang@huawei.com> Signed-off-by: Ye Bin <yebin10@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> --- fs/ext4/super.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index cc057001961e..b10f96860dd8 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -2305,6 +2305,7 @@ static int ext4_setup_super(struct super_block *sb, struct ext4_super_block *es, ext4_msg(sb, KERN_ERR, "revision level too high, " "forcing read-only mode"); err = -EROFS; + goto done; } if (read_only) goto done; -- 2.25.1
participants (1)
-
Yang Yingliang