From: jiazhenyuan <jiazhenyuan@uniontech.com>
To: cem@kernel.org, djwong@kernel.org, kees@kernel.org,
linux-xfs@vger.kernel.org, hch@infradead.org
Cc: linux-kernel@vger.kernel.org, kernel@uniontech.com
Subject: [PATCH] xfs: fix AGFL extent count calculation in xrep_agfl_fill
Date: Tue, 23 Jun 2026 10:41:53 +0800 [thread overview]
Message-ID: <20260623024153.835431-1-jiazhenyuan@uniontech.com> (raw)
In xrep_agfl_fill(), the call to xagb_bitmap_set() passes
'agbno - 1' as the length argument. However, xagb_bitmap_set()
expects a length (number of blocks), not an end block number.
Passing 'agbno - 1' causes used_extents to record an incorrect
range.
Fix this by calculating the correct length as 'agbno - start',
which represents the actual number of blocks filled into the AGFL.
Signed-off-by: jiazhenyuan <jiazhenyuan@uniontech.com>
---
| 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--git a/fs/xfs/scrub/agheader_repair.c b/fs/xfs/scrub/agheader_repair.c
index ae9ed5f280d0..b0ffd37afb45 100644
--- a/fs/xfs/scrub/agheader_repair.c
+++ b/fs/xfs/scrub/agheader_repair.c
@@ -652,7 +652,7 @@ xrep_agfl_fill(
while (agbno < start + len && af->fl_off < af->flcount)
af->agfl_bno[af->fl_off++] = cpu_to_be32(agbno++);
- error = xagb_bitmap_set(&af->used_extents, start, agbno - 1);
+ error = xagb_bitmap_set(&af->used_extents, start, agbno - start);
if (error)
return error;
--
2.20.1
next reply other threads:[~2026-06-23 2:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-23 2:41 jiazhenyuan [this message]
2026-06-24 17:08 ` Darrick J. Wong
2026-07-01 12:50 ` Carlos Maiolino
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=20260623024153.835431-1-jiazhenyuan@uniontech.com \
--to=jiazhenyuan@uniontech.com \
--cc=cem@kernel.org \
--cc=djwong@kernel.org \
--cc=hch@infradead.org \
--cc=kees@kernel.org \
--cc=kernel@uniontech.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
/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®