Skip to contentSkip to conversation

ext4: stop overwrite the errcode in ext4_setup_super

PATCH Applied yangerkun 3 participants 3 messages Jun 1, 2020 – Jun 11, 2020 ext4 file system

lore
Share & tools
lore

yangerkun

author
#0 lore raw

PATCH 1/1 ext4: stop overwrite the errcode in ext4_setup_super

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")
---
 fs/ext4/super.c | 1 +
 1 file changed, 1 insertion(+)
fs/ext4/super.c +1 -0
index bf5fcb477f66..87c5611a4c67 100644
@@ -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;
Signature · 1 line
2.25.4
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · yangerkun

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")

Yeah, makes sense. You can add:

Honza

Quoted 19 lines
---
 fs/ext4/super.c | 1 +
 1 file changed, 1 insertion(+)
fs/ext4/super.c +1 -0
index bf5fcb477f66..87c5611a4c67 100644
@@ -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;
Signature · 1 line
2.25.4
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
maintainer Applied
#2 lore raw
Quoted 11 lines · Jan Kara
Quoted 6 lines · yangerkun

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")

Yeah, makes sense. You can add:

Thanks, applied.

- Ted