public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] repair: fix process_rt_rec_dups
@ 2023-11-08 17:53 Christoph Hellwig
  2023-11-08 18:08 ` Darrick J. Wong
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2023-11-08 17:53 UTC (permalink / raw)
  To: linux-xfs

search_rt_dup_extent takes a xfs_rtblock_t, not an RT extent number.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---

What scares me about this is that no test seems to hit this and report
false duplicates.  I'll need to see if I can come up with an
artifical reproducers of some kind.

 repair/dinode.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/repair/dinode.c b/repair/dinode.c
index c10dd1fa3..9aa367138 100644
--- a/repair/dinode.c
+++ b/repair/dinode.c
@@ -194,13 +194,11 @@ process_rt_rec_dups(
 	struct xfs_bmbt_irec	*irec)
 {
 	xfs_fsblock_t		b;
-	xfs_rtblock_t		ext;
 
 	for (b = rounddown(irec->br_startblock, mp->m_sb.sb_rextsize);
 	     b < irec->br_startblock + irec->br_blockcount;
 	     b += mp->m_sb.sb_rextsize) {
-		ext = (xfs_rtblock_t) b / mp->m_sb.sb_rextsize;
-		if (search_rt_dup_extent(mp, ext))  {
+		if (search_rt_dup_extent(mp, b))  {
 			do_warn(
 _("data fork in rt ino %" PRIu64 " claims dup rt extent,"
 "off - %" PRIu64 ", start - %" PRIu64 ", count %" PRIu64 "\n"),
-- 
2.39.2


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

end of thread, other threads:[~2023-11-09  4:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-08 17:53 [PATCH] repair: fix process_rt_rec_dups Christoph Hellwig
2023-11-08 18:08 ` Darrick J. Wong
2023-11-08 18:21   ` Christoph Hellwig
2023-11-08 19:20     ` Darrick J. Wong
2023-11-09  4:44       ` Christoph Hellwig

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