ext4: stop overwrite the errcode in ext4_setup_super
authoryangerkun <yangerkun@huawei.com>
Mon, 1 Jun 2020 07:34:04 +0000 (15:34 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 11 Jun 2020 14:59:38 +0000 (10:59 -0400)
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>
fs/ext4/super.c

index edf06c1bee9d40116ef7f43796a21d2a2a230467..127b8efa8d54f9e8a19062e954689403590fe82a 100644 (file)
@@ -2412,6 +2412,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;