Commit 2f79d8ab authored by yangerkun's avatar yangerkun Committed by Greg Kroah-Hartman
Browse files

ext4: stop overwrite the errcode in ext4_setup_super



[ Upstream commit 5adaccac ]

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: c89128a0 ("ext4: handle errors on ext4_commit_super")
Signed-off-by: default avataryangerkun <yangerkun@huawei.com>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20200601073404.3712492-1-yangerkun@huawei.com


Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 4e3f8bb5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2344,6 +2344,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;