public inbox for linux-bcachefs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] bcachefs: Ignore accounting key type larger than BCH_DISK_ACCOUNTING_TYPE_NR
@ 2025-08-04 16:41 Alan Huang
  2025-08-04 16:51 ` Kent Overstreet
  0 siblings, 1 reply; 2+ messages in thread
From: Alan Huang @ 2025-08-04 16:41 UTC (permalink / raw)
  To: kent.overstreet; +Cc: linux-bcachefs, Alan Huang, syzbot+cd063f869beedf5b9cd7

Reported-by: syzbot+cd063f869beedf5b9cd7@syzkaller.appspotmail.com
Signed-off-by: Alan Huang <mmpgouride@gmail.com>
---
 fs/bcachefs/disk_accounting.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/bcachefs/disk_accounting.c b/fs/bcachefs/disk_accounting.c
index f96530c70262..5944ad6d0f8d 100644
--- a/fs/bcachefs/disk_accounting.c
+++ b/fs/bcachefs/disk_accounting.c
@@ -184,6 +184,9 @@ int bch2_accounting_validate(struct bch_fs *c, struct bkey_s_c k,
 	void *end = &acc_k + 1;
 	int ret = 0;
 
+	if (acc_k.type >= BCH_DISK_ACCOUNTING_TYPE_NR)
+		return 0;
+
 	bkey_fsck_err_on((from.flags & BCH_VALIDATE_commit) &&
 			 bversion_zero(k.k->bversion),
 			 c, accounting_key_version_0,
-- 
2.49.0


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

* Re: [PATCH v2] bcachefs: Ignore accounting key type larger than BCH_DISK_ACCOUNTING_TYPE_NR
  2025-08-04 16:41 [PATCH v2] bcachefs: Ignore accounting key type larger than BCH_DISK_ACCOUNTING_TYPE_NR Alan Huang
@ 2025-08-04 16:51 ` Kent Overstreet
  0 siblings, 0 replies; 2+ messages in thread
From: Kent Overstreet @ 2025-08-04 16:51 UTC (permalink / raw)
  To: Alan Huang; +Cc: linux-bcachefs, syzbot+cd063f869beedf5b9cd7

On Tue, Aug 05, 2025 at 12:41:05AM +0800, Alan Huang wrote:
> Reported-by: syzbot+cd063f869beedf5b9cd7@syzkaller.appspotmail.com
> Signed-off-by: Alan Huang <mmpgouride@gmail.com>

Applied

> ---
>  fs/bcachefs/disk_accounting.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/fs/bcachefs/disk_accounting.c b/fs/bcachefs/disk_accounting.c
> index f96530c70262..5944ad6d0f8d 100644
> --- a/fs/bcachefs/disk_accounting.c
> +++ b/fs/bcachefs/disk_accounting.c
> @@ -184,6 +184,9 @@ int bch2_accounting_validate(struct bch_fs *c, struct bkey_s_c k,
>  	void *end = &acc_k + 1;
>  	int ret = 0;
>  
> +	if (acc_k.type >= BCH_DISK_ACCOUNTING_TYPE_NR)
> +		return 0;
> +
>  	bkey_fsck_err_on((from.flags & BCH_VALIDATE_commit) &&
>  			 bversion_zero(k.k->bversion),
>  			 c, accounting_key_version_0,
> -- 
> 2.49.0
> 

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

end of thread, other threads:[~2025-08-04 16:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-04 16:41 [PATCH v2] bcachefs: Ignore accounting key type larger than BCH_DISK_ACCOUNTING_TYPE_NR Alan Huang
2025-08-04 16:51 ` Kent Overstreet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox