mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: Zhiguo Niu <zhiguo.niu@unisoc.com>, jaegeuk@kernel.org
Cc: linux-f2fs-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, niuzhiguo84@gmail.com,
	ke.wang@unisoc.com, hongyu.jin@unisoc.com
Subject: Re: [PATCH 1/2] f2fs: fix to remove f2fs_bug_on in add_bio_entry
Date: Mon, 11 Mar 2024 11:54:01 +0800	[thread overview]
Message-ID: <67a7f35d-5cc3-4b5f-968a-e4151c63eb74@kernel.org> (raw)
In-Reply-To: <1709892753-27461-1-git-send-email-zhiguo.niu@unisoc.com>

On 2024/3/8 18:12, Zhiguo Niu wrote:
> add_bio_entry should not trigger system panic when bio_add_page fail,
> fix to remove it.
> 
> Fixes: 0b20fcec8651 ("f2fs: cache global IPU bio")
> Signed-off-by: Zhiguo Niu <zhiguo.niu@unisoc.com>
> ---
>   fs/f2fs/data.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index d9494b5..f8ae684 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -759,8 +759,10 @@ static void add_bio_entry(struct f2fs_sb_info *sbi, struct bio *bio,
>   	be->bio = bio;
>   	bio_get(bio);
>   
> -	if (bio_add_page(bio, page, PAGE_SIZE, 0) != PAGE_SIZE)
> -		f2fs_bug_on(sbi, 1);
> +	if (bio_add_page(bio, page, PAGE_SIZE, 0) != PAGE_SIZE) {
> +		bio_put(bio);

I didn't get it, why new created bio has no space to store one page?

Thanks,

> +		return;
> +	}
>   
>   	f2fs_down_write(&io->bio_list_lock);
>   	list_add_tail(&be->list, &io->bio_list);

  parent reply	other threads:[~2024-03-11  3:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-08 10:12 Zhiguo Niu
2024-03-08 10:12 ` [PATCH 2/2] f2fs: fix to handle error paths of {new,change}_curseg() Zhiguo Niu
2024-03-11  6:09   ` Chao Yu
2024-03-11  7:19     ` Zhiguo Niu
2024-03-11  3:54 ` Chao Yu [this message]
2024-03-11  7:26   ` [PATCH 1/2] f2fs: fix to remove f2fs_bug_on in add_bio_entry 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=67a7f35d-5cc3-4b5f-968a-e4151c63eb74@kernel.org \
    --to=chao@kernel.org \
    --cc=hongyu.jin@unisoc.com \
    --cc=jaegeuk@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®