linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH] f2fs: fix false alarm on invalid block address
@ 2024-04-24 17:35 Jaegeuk Kim
  2024-04-25  1:23 ` Chao Yu
  2024-04-25 15:40 ` patchwork-bot+f2fs
  0 siblings, 2 replies; 6+ messages in thread
From: Jaegeuk Kim @ 2024-04-24 17:35 UTC (permalink / raw)
  To: linux-kernel, linux-f2fs-devel; +Cc: Jaegeuk Kim, stable

f2fs_ra_meta_pages can try to read ahead on invalid block address which is
not the corruption case.

Cc: <stable@kernel.org> # v6.9+
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=218770
Fixes: 31f85ccc84b8 ("f2fs: unify the error handling of f2fs_is_valid_blkaddr")
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/checkpoint.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 5d05a413f451..55d444bec5c0 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -179,22 +179,22 @@ static bool __f2fs_is_valid_blkaddr(struct f2fs_sb_info *sbi,
 		break;
 	case META_SIT:
 		if (unlikely(blkaddr >= SIT_BLK_CNT(sbi)))
-			goto err;
+			goto check_only;
 		break;
 	case META_SSA:
 		if (unlikely(blkaddr >= MAIN_BLKADDR(sbi) ||
 			blkaddr < SM_I(sbi)->ssa_blkaddr))
-			goto err;
+			goto check_only;
 		break;
 	case META_CP:
 		if (unlikely(blkaddr >= SIT_I(sbi)->sit_base_addr ||
 			blkaddr < __start_cp_addr(sbi)))
-			goto err;
+			goto check_only;
 		break;
 	case META_POR:
 		if (unlikely(blkaddr >= MAX_BLKADDR(sbi) ||
 			blkaddr < MAIN_BLKADDR(sbi)))
-			goto err;
+			goto check_only;
 		break;
 	case DATA_GENERIC:
 	case DATA_GENERIC_ENHANCE:
@@ -228,6 +228,7 @@ static bool __f2fs_is_valid_blkaddr(struct f2fs_sb_info *sbi,
 	return true;
 err:
 	f2fs_handle_error(sbi, ERROR_INVALID_BLKADDR);
+check_only:
 	return false;
 }
 
-- 
2.44.0.769.g3c40516874-goog



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

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

* Re: [f2fs-dev] [PATCH] f2fs: fix false alarm on invalid block address
  2024-04-24 17:35 Jaegeuk Kim
@ 2024-04-25  1:23 ` Chao Yu
  2024-04-25 15:40 ` patchwork-bot+f2fs
  1 sibling, 0 replies; 6+ messages in thread
From: Chao Yu @ 2024-04-25  1:23 UTC (permalink / raw)
  To: Jaegeuk Kim, linux-kernel, linux-f2fs-devel; +Cc: stable

On 2024/4/25 1:35, Jaegeuk Kim wrote:
> f2fs_ra_meta_pages can try to read ahead on invalid block address which is
> not the corruption case.
> 
> Cc: <stable@kernel.org> # v6.9+
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=218770
> Fixes: 31f85ccc84b8 ("f2fs: unify the error handling of f2fs_is_valid_blkaddr")
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,


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

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

* Re: [f2fs-dev] [PATCH] f2fs: fix false alarm on invalid block address
  2024-04-24 17:35 Jaegeuk Kim
  2024-04-25  1:23 ` Chao Yu
@ 2024-04-25 15:40 ` patchwork-bot+f2fs
  1 sibling, 0 replies; 6+ messages in thread
From: patchwork-bot+f2fs @ 2024-04-25 15:40 UTC (permalink / raw)
  To: Jaegeuk Kim; +Cc: stable, linux-kernel, linux-f2fs-devel

Hello:

This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <jaegeuk@kernel.org>:

On Wed, 24 Apr 2024 17:35:48 +0000 you wrote:
> f2fs_ra_meta_pages can try to read ahead on invalid block address which is
> not the corruption case.
> 
> Cc: <stable@kernel.org> # v6.9+
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=218770
> Fixes: 31f85ccc84b8 ("f2fs: unify the error handling of f2fs_is_valid_blkaddr")
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> 
> [...]

Here is the summary with links:
  - [f2fs-dev] f2fs: fix false alarm on invalid block address
    https://git.kernel.org/jaegeuk/f2fs/c/b864ddb57eb0

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html




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

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

* [f2fs-dev] [PATCH] f2fs: fix false alarm on invalid block address
@ 2024-05-20 22:02 Jaegeuk Kim
  2024-05-23 17:44 ` Jaegeuk Kim
  0 siblings, 1 reply; 6+ messages in thread
From: Jaegeuk Kim @ 2024-05-20 22:02 UTC (permalink / raw)
  To: linux-stable, linux-f2fs-devel, Greg Kroah-Hartman; +Cc: Jaegeuk Kim, stable

f2fs_ra_meta_pages can try to read ahead on invalid block address which is
not the corruption case.

Cc: <stable@kernel.org> # v6.9+
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=218770
Fixes: 31f85ccc84b8 ("f2fs: unify the error handling of f2fs_is_valid_blkaddr")
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/checkpoint.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 5d05a413f451..55d444bec5c0 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -179,22 +179,22 @@ static bool __f2fs_is_valid_blkaddr(struct f2fs_sb_info *sbi,
 		break;
 	case META_SIT:
 		if (unlikely(blkaddr >= SIT_BLK_CNT(sbi)))
-			goto err;
+			goto check_only;
 		break;
 	case META_SSA:
 		if (unlikely(blkaddr >= MAIN_BLKADDR(sbi) ||
 			blkaddr < SM_I(sbi)->ssa_blkaddr))
-			goto err;
+			goto check_only;
 		break;
 	case META_CP:
 		if (unlikely(blkaddr >= SIT_I(sbi)->sit_base_addr ||
 			blkaddr < __start_cp_addr(sbi)))
-			goto err;
+			goto check_only;
 		break;
 	case META_POR:
 		if (unlikely(blkaddr >= MAX_BLKADDR(sbi) ||
 			blkaddr < MAIN_BLKADDR(sbi)))
-			goto err;
+			goto check_only;
 		break;
 	case DATA_GENERIC:
 	case DATA_GENERIC_ENHANCE:
@@ -228,6 +228,7 @@ static bool __f2fs_is_valid_blkaddr(struct f2fs_sb_info *sbi,
 	return true;
 err:
 	f2fs_handle_error(sbi, ERROR_INVALID_BLKADDR);
+check_only:
 	return false;
 }
 
-- 
2.45.0.rc1.225.g2a3ae87e7f-goog



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

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

* Re: [f2fs-dev] [PATCH] f2fs: fix false alarm on invalid block address
  2024-05-20 22:02 [f2fs-dev] [PATCH] f2fs: fix false alarm on invalid block address Jaegeuk Kim
@ 2024-05-23 17:44 ` Jaegeuk Kim
  2024-05-23 17:46   ` Jaegeuk Kim
  0 siblings, 1 reply; 6+ messages in thread
From: Jaegeuk Kim @ 2024-05-23 17:44 UTC (permalink / raw)
  To: linux-stable, linux-f2fs-devel, Greg Kroah-Hartman; +Cc: stable

Hi Greg,

Could you please consider to cherry-pick this patch in stable-6.9, since
there are many users suffering from unnecessary fsck runs during boot?

You can get this from Linus's tree by
(b864ddb57eb0 "f2fs: fix false alarm on invalid block address")

Thanks,

On 05/20, Jaegeuk Kim wrote:
> f2fs_ra_meta_pages can try to read ahead on invalid block address which is
> not the corruption case.
> 
> Cc: <stable@kernel.org> # v6.9+
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=218770
> Fixes: 31f85ccc84b8 ("f2fs: unify the error handling of f2fs_is_valid_blkaddr")
> Reviewed-by: Chao Yu <chao@kernel.org>
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> ---
>  fs/f2fs/checkpoint.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
> index 5d05a413f451..55d444bec5c0 100644
> --- a/fs/f2fs/checkpoint.c
> +++ b/fs/f2fs/checkpoint.c
> @@ -179,22 +179,22 @@ static bool __f2fs_is_valid_blkaddr(struct f2fs_sb_info *sbi,
>  		break;
>  	case META_SIT:
>  		if (unlikely(blkaddr >= SIT_BLK_CNT(sbi)))
> -			goto err;
> +			goto check_only;
>  		break;
>  	case META_SSA:
>  		if (unlikely(blkaddr >= MAIN_BLKADDR(sbi) ||
>  			blkaddr < SM_I(sbi)->ssa_blkaddr))
> -			goto err;
> +			goto check_only;
>  		break;
>  	case META_CP:
>  		if (unlikely(blkaddr >= SIT_I(sbi)->sit_base_addr ||
>  			blkaddr < __start_cp_addr(sbi)))
> -			goto err;
> +			goto check_only;
>  		break;
>  	case META_POR:
>  		if (unlikely(blkaddr >= MAX_BLKADDR(sbi) ||
>  			blkaddr < MAIN_BLKADDR(sbi)))
> -			goto err;
> +			goto check_only;
>  		break;
>  	case DATA_GENERIC:
>  	case DATA_GENERIC_ENHANCE:
> @@ -228,6 +228,7 @@ static bool __f2fs_is_valid_blkaddr(struct f2fs_sb_info *sbi,
>  	return true;
>  err:
>  	f2fs_handle_error(sbi, ERROR_INVALID_BLKADDR);
> +check_only:
>  	return false;
>  }
>  
> -- 
> 2.45.0.rc1.225.g2a3ae87e7f-goog


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

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

* Re: [f2fs-dev] [PATCH] f2fs: fix false alarm on invalid block address
  2024-05-23 17:44 ` Jaegeuk Kim
@ 2024-05-23 17:46   ` Jaegeuk Kim
  0 siblings, 0 replies; 6+ messages in thread
From: Jaegeuk Kim @ 2024-05-23 17:46 UTC (permalink / raw)
  To: stable, linux-f2fs-devel, Greg Kroah-Hartman; +Cc: stable

Fixed the stable mailing list.

On 05/23, Jaegeuk Kim wrote:
> Hi Greg,
> 
> Could you please consider to cherry-pick this patch in stable-6.9, since
> there are many users suffering from unnecessary fsck runs during boot?
> 
> You can get this from Linus's tree by
> (b864ddb57eb0 "f2fs: fix false alarm on invalid block address")
> 
> Thanks,
> 
> On 05/20, Jaegeuk Kim wrote:
> > f2fs_ra_meta_pages can try to read ahead on invalid block address which is
> > not the corruption case.
> > 
> > Cc: <stable@kernel.org> # v6.9+
> > Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=218770
> > Fixes: 31f85ccc84b8 ("f2fs: unify the error handling of f2fs_is_valid_blkaddr")
> > Reviewed-by: Chao Yu <chao@kernel.org>
> > Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> > ---
> >  fs/f2fs/checkpoint.c | 9 +++++----
> >  1 file changed, 5 insertions(+), 4 deletions(-)
> > 
> > diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
> > index 5d05a413f451..55d444bec5c0 100644
> > --- a/fs/f2fs/checkpoint.c
> > +++ b/fs/f2fs/checkpoint.c
> > @@ -179,22 +179,22 @@ static bool __f2fs_is_valid_blkaddr(struct f2fs_sb_info *sbi,
> >  		break;
> >  	case META_SIT:
> >  		if (unlikely(blkaddr >= SIT_BLK_CNT(sbi)))
> > -			goto err;
> > +			goto check_only;
> >  		break;
> >  	case META_SSA:
> >  		if (unlikely(blkaddr >= MAIN_BLKADDR(sbi) ||
> >  			blkaddr < SM_I(sbi)->ssa_blkaddr))
> > -			goto err;
> > +			goto check_only;
> >  		break;
> >  	case META_CP:
> >  		if (unlikely(blkaddr >= SIT_I(sbi)->sit_base_addr ||
> >  			blkaddr < __start_cp_addr(sbi)))
> > -			goto err;
> > +			goto check_only;
> >  		break;
> >  	case META_POR:
> >  		if (unlikely(blkaddr >= MAX_BLKADDR(sbi) ||
> >  			blkaddr < MAIN_BLKADDR(sbi)))
> > -			goto err;
> > +			goto check_only;
> >  		break;
> >  	case DATA_GENERIC:
> >  	case DATA_GENERIC_ENHANCE:
> > @@ -228,6 +228,7 @@ static bool __f2fs_is_valid_blkaddr(struct f2fs_sb_info *sbi,
> >  	return true;
> >  err:
> >  	f2fs_handle_error(sbi, ERROR_INVALID_BLKADDR);
> > +check_only:
> >  	return false;
> >  }
> >  
> > -- 
> > 2.45.0.rc1.225.g2a3ae87e7f-goog


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

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

end of thread, other threads:[~2024-05-23 17:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-20 22:02 [f2fs-dev] [PATCH] f2fs: fix false alarm on invalid block address Jaegeuk Kim
2024-05-23 17:44 ` Jaegeuk Kim
2024-05-23 17:46   ` Jaegeuk Kim
  -- strict thread matches above, loose matches on Subject: below --
2024-04-24 17:35 Jaegeuk Kim
2024-04-25  1:23 ` Chao Yu
2024-04-25 15:40 ` patchwork-bot+f2fs

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