From: Tristan Madani <tristmd@gmail.com>
To: agruenba@redhat.com
Cc: gfs2@lists.linux.dev, linux-kernel@vger.kernel.org,
syzbot+3e2c95229d1ab81a0bfd@syzkaller.appspotmail.com
Subject: [PATCH] gfs2: replace WARN_ON_ONCE with fs_warn in rgblk_free
Date: Sat, 18 Apr 2026 13:11:03 +0000 [thread overview]
Message-ID: <20260418131103.1058618-1-tristmd@gmail.com> (raw)
From: Tristan Madani <tristan@talencesecurity.com>
rgblk_free() triggers WARN_ON_ONCE when gfs2_rbm_from_block() fails
due to a block number outside the resource group bounds. This can be
triggered by a corrupted filesystem image, causing unnecessary kernel
warnings.
Replace WARN_ON_ONCE with fs_warn() to provide a more informative
diagnostic message while avoiding the kernel warning.
Reported-by: syzbot+3e2c95229d1ab81a0bfd@syzkaller.appspotmail.com
Fixes: 5b924ae2b7b4 ("GFS2: fix rgrp end rounding problem for bsize < page size")
Cc: stable@vger.kernel.org
Signed-off-by: Tristan Madani <tristan@talencesecurity.com>
---
fs/gfs2/rgrp.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 26d6c1eea5591..7707c1b1082f8 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -2266,8 +2266,11 @@ static void rgblk_free(struct gfs2_sbd *sdp, struct gfs2_rgrpd *rgd,
struct gfs2_bitmap *bi, *bi_prev = NULL;
rbm.rgd = rgd;
- if (WARN_ON_ONCE(gfs2_rbm_from_block(&rbm, bstart)))
+ if (gfs2_rbm_from_block(&rbm, bstart)) {
+ fs_warn(sdp, "rgblk_free: block %llu outside rgrp\n",
+ (unsigned long long)bstart);
return;
+ }
while (blen--) {
bi = rbm_bi(&rbm);
if (bi != bi_prev) {
--
2.47.3
reply other threads:[~2026-04-18 13:11 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260418131103.1058618-1-tristmd@gmail.com \
--to=tristmd@gmail.com \
--cc=agruenba@redhat.com \
--cc=gfs2@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+3e2c95229d1ab81a0bfd@syzkaller.appspotmail.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