| From 7d171e59aeb2d64075d76c75dc460057e72e89bb Mon Sep 17 00:00:00 2001 |
| From: yangerkun <yangerkun@huawei.com> |
| Date: Mon, 1 Jun 2020 15:34:04 +0800 |
| Subject: [PATCH] ext4: stop overwrite the errcode in ext4_setup_super |
| |
| commit 5adaccac46ea79008d7b75f47913f1a00f91d0ce upstream. |
| |
| 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: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/fs/ext4/super.c b/fs/ext4/super.c |
| index bc784f5fbd19..d23a14971d32 100644 |
| --- a/fs/ext4/super.c |
| +++ b/fs/ext4/super.c |
| @@ -2283,6 +2283,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.27.0 |
| |