All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chao Yu <chao@kernel.org>
Cc: Pavel Machek <pavel@denx.de>,
	linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: fix to unlock page correctly in error path of is_alive()
Date: Thu, 3 Feb 2022 12:03:34 -0800	[thread overview]
Message-ID: <Yfw1FnkiO+U+zGS0@google.com> (raw)
In-Reply-To: <20220203144705.23528-1-chao@kernel.org>

On 02/03, Chao Yu wrote:
> As Pavel Machek reported in below link [1]:
> 
> After commit 77900c45ee5c ("f2fs: fix to do sanity check in is_alive()"),
> node page should be unlock via calling f2fs_put_page() in the error path
> of is_alive(), otherwise, f2fs may hang when it tries to lock the node
> page, fix it.
> 
> [1] https://lore.kernel.org/stable/20220124203637.GA19321@duo.ucw.cz/

Need -stable? It seems 4.19+?

> 
> Fixes: 77900c45ee5c ("f2fs: fix to do sanity check in is_alive()")
> Reported-by: Pavel Machek <pavel@denx.de>
> Signed-off-by: Pavel Machek <pavel@denx.de>
> Signed-off-by: Chao Yu <chao@kernel.org>
> ---
>  fs/f2fs/gc.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
> index 0a6b0a8ae97e..2d53ef121e76 100644
> --- a/fs/f2fs/gc.c
> +++ b/fs/f2fs/gc.c
> @@ -1038,8 +1038,10 @@ static bool is_alive(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
>  		set_sbi_flag(sbi, SBI_NEED_FSCK);
>  	}
>  
> -	if (f2fs_check_nid_range(sbi, dni->ino))
> +	if (f2fs_check_nid_range(sbi, dni->ino)) {
> +		f2fs_put_page(node_page, 1);
>  		return false;
> +	}
>  
>  	*nofs = ofs_of_node(node_page);
>  	source_blkaddr = data_blkaddr(NULL, node_page, ofs_in_node);
> -- 
> 2.32.0


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

WARNING: multiple messages have this Message-ID (diff)
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chao Yu <chao@kernel.org>
Cc: linux-f2fs-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, Pavel Machek <pavel@denx.de>
Subject: Re: [PATCH] f2fs: fix to unlock page correctly in error path of is_alive()
Date: Thu, 3 Feb 2022 12:03:34 -0800	[thread overview]
Message-ID: <Yfw1FnkiO+U+zGS0@google.com> (raw)
In-Reply-To: <20220203144705.23528-1-chao@kernel.org>

On 02/03, Chao Yu wrote:
> As Pavel Machek reported in below link [1]:
> 
> After commit 77900c45ee5c ("f2fs: fix to do sanity check in is_alive()"),
> node page should be unlock via calling f2fs_put_page() in the error path
> of is_alive(), otherwise, f2fs may hang when it tries to lock the node
> page, fix it.
> 
> [1] https://lore.kernel.org/stable/20220124203637.GA19321@duo.ucw.cz/

Need -stable? It seems 4.19+?

> 
> Fixes: 77900c45ee5c ("f2fs: fix to do sanity check in is_alive()")
> Reported-by: Pavel Machek <pavel@denx.de>
> Signed-off-by: Pavel Machek <pavel@denx.de>
> Signed-off-by: Chao Yu <chao@kernel.org>
> ---
>  fs/f2fs/gc.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
> index 0a6b0a8ae97e..2d53ef121e76 100644
> --- a/fs/f2fs/gc.c
> +++ b/fs/f2fs/gc.c
> @@ -1038,8 +1038,10 @@ static bool is_alive(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
>  		set_sbi_flag(sbi, SBI_NEED_FSCK);
>  	}
>  
> -	if (f2fs_check_nid_range(sbi, dni->ino))
> +	if (f2fs_check_nid_range(sbi, dni->ino)) {
> +		f2fs_put_page(node_page, 1);
>  		return false;
> +	}
>  
>  	*nofs = ofs_of_node(node_page);
>  	source_blkaddr = data_blkaddr(NULL, node_page, ofs_in_node);
> -- 
> 2.32.0

  reply	other threads:[~2022-02-03 20:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-03 14:47 [f2fs-dev] [PATCH] f2fs: fix to unlock page correctly in error path of is_alive() Chao Yu
2022-02-03 14:47 ` Chao Yu
2022-02-03 20:03 ` Jaegeuk Kim [this message]
2022-02-03 20:03   ` Jaegeuk Kim
2022-02-04  3:19   ` [f2fs-dev] " Chao Yu
2022-02-04  3:19     ` Chao Yu

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=Yfw1FnkiO+U+zGS0@google.com \
    --to=jaegeuk@kernel.org \
    --cc=chao@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.