mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Zhiguo Niu <zhiguo.niu@unisoc.com>
Cc: chao@kernel.org, linux-f2fs-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, niuzhiguo84@gmail.com,
	ke.wang@unisoc.com, Hao_hao.Wang@unisoc.com
Subject: Re: [PATCH] f2fs: fix to check return value of f2fs_allocate_new_section
Date: Mon, 20 May 2024 19:52:25 +0000	[thread overview]
Message-ID: <Zkup-c2K74bxVJ0i@google.com> (raw)
In-Reply-To: <1715945202-30045-1-git-send-email-zhiguo.niu@unisoc.com>

On 05/17, Zhiguo Niu wrote:
> commit 245930617c9b ("f2fs: fix to handle error paths of {new,change}_curseg()")
> missed this allocated path, fix it.
> 
> Signed-off-by: Zhiguo Niu <zhiguo.niu@unisoc.com>
> ---
>  fs/f2fs/segment.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> index a0ce3d0..71dc8042 100644
> --- a/fs/f2fs/segment.c
> +++ b/fs/f2fs/segment.c
> @@ -5190,7 +5190,9 @@ static int fix_curseg_write_pointer(struct f2fs_sb_info *sbi, int type)
>  	if (cs->next_blkoff) {
>  		unsigned int old_segno = cs->segno, old_blkoff = cs->next_blkoff;
>  
> -		f2fs_allocate_new_section(sbi, type, true);
> +		err = f2fs_allocate_new_section(sbi, type, true);
> +		if (err)
> +			return err;

I hesitate to apply this, since this may give mount failures forever. Do you see
a real issue with this?

>  		f2fs_notice(sbi, "Assign new section to curseg[%d]: "
>  				"[0x%x,0x%x] -> [0x%x,0x%x]",
>  				type, old_segno, old_blkoff,
> -- 
> 1.9.1

  parent reply	other threads:[~2024-05-20 19:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-17 11:26 Zhiguo Niu
2024-05-17 16:55 ` Markus Elfring
2024-05-20  1:21 ` Chao Yu
2024-05-20 19:52 ` Jaegeuk Kim [this message]
2024-05-21  0:56   ` Zhiguo Niu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Zkup-c2K74bxVJ0i@google.com \
    --to=jaegeuk@kernel.org \
    --cc=Hao_hao.Wang@unisoc.com \
    --cc=chao@kernel.org \
    --cc=ke.wang@unisoc.com \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=niuzhiguo84@gmail.com \
    --cc=zhiguo.niu@unisoc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®