summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryangerkun <yangerkun@huawei.com>2020-06-01 15:34:04 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-06-24 17:50:45 +0200
commit889b69a9982b6b9db212af307a1c50c2462a1d16 (patch)
treec681d96a658b41c3d6e109031671c41c0f3d8e46
parentaa7baef53057780bf7b47fb3256c4452eb228b32 (diff)
ext4: stop overwrite the errcode in ext4_setup_super
[ Upstream commit 5adaccac46ea79008d7b75f47913f1a00f91d0ce ] 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: Jan Kara <jack@suse.cz> Link: https://lore.kernel.org/r/20200601073404.3712492-1-yangerkun@huawei.com Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--fs/ext4/super.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index d3500eaf900e2..830160ad07a63 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -2294,6 +2294,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;