linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: stop overwrite the errcode in ext4_setup_super
@ 2020-06-01  7:34 yangerkun
  2020-06-01 11:47 ` Jan Kara
  0 siblings, 1 reply; 3+ messages in thread
From: yangerkun @ 2020-06-01  7:34 UTC (permalink / raw)
  To: tytso, jaegeuk, jack; +Cc: linux-ext4, yi.zhang, 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")
Signed-off-by: yangerkun <yangerkun@huawei.com>
---
 fs/ext4/super.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index bf5fcb477f66..87c5611a4c67 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -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;
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ext4: stop overwrite the errcode in ext4_setup_super
  2020-06-01  7:34 [PATCH] ext4: stop overwrite the errcode in ext4_setup_super yangerkun
@ 2020-06-01 11:47 ` Jan Kara
  2020-06-11 14:59   ` Theodore Y. Ts'o
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kara @ 2020-06-01 11:47 UTC (permalink / raw)
  To: yangerkun; +Cc: tytso, jaegeuk, jack, linux-ext4, yi.zhang

On Mon 01-06-20 15:34:04, yangerkun wrote:
> 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>

Yeah, makes sense. You can add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  fs/ext4/super.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index bf5fcb477f66..87c5611a4c67 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -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;
> -- 
> 2.25.4
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ext4: stop overwrite the errcode in ext4_setup_super
  2020-06-01 11:47 ` Jan Kara
@ 2020-06-11 14:59   ` Theodore Y. Ts'o
  0 siblings, 0 replies; 3+ messages in thread
From: Theodore Y. Ts'o @ 2020-06-11 14:59 UTC (permalink / raw)
  To: Jan Kara; +Cc: yangerkun, jaegeuk, linux-ext4, yi.zhang

On Mon, Jun 01, 2020 at 01:47:08PM +0200, Jan Kara wrote:
> On Mon 01-06-20 15:34:04, yangerkun wrote:
> > 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>
> 
> Yeah, makes sense. You can add:
> 
> Reviewed-by: Jan Kara <jack@suse.cz>

Thanks, applied.

					- Ted

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-06-11 15:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-01  7:34 [PATCH] ext4: stop overwrite the errcode in ext4_setup_super yangerkun
2020-06-01 11:47 ` Jan Kara
2020-06-11 14:59   ` Theodore Y. Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).