public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: linux-xfs@vger.kernel.org
Subject: [PATCH] repair: fix the call to search_rt_dup_extent in scan_bmapbt
Date: Thu,  9 Nov 2023 17:02:33 +0100	[thread overview]
Message-ID: <20231109160233.703566-1-hch@lst.de> (raw)

search_rt_dup_extent expects an RT extent number and not a fsbno.
Convert the units before the call.  Without this we are unlikely
to ever found a legit duplicate extent on the RT subvolume because
the search will always be off the end.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 repair/scan.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/repair/scan.c b/repair/scan.c
index 27a33286a..7a0587615 100644
--- a/repair/scan.c
+++ b/repair/scan.c
@@ -402,8 +402,10 @@ _("bad state %d, inode %" PRIu64 " bmap block 0x%" PRIx64 "\n"),
 					XFS_FSB_TO_AGBNO(mp, bno) + 1))
 				return(1);
 		} else  {
-			if (search_rt_dup_extent(mp, bno))
-				return(1);
+			xfs_rtblock_t	ext = bno / mp->m_sb.sb_rextsize;
+
+			if (search_rt_dup_extent(mp, ext))
+				return 1;
 		}
 	}
 	(*tot)++;
-- 
2.39.2


             reply	other threads:[~2023-11-09 16:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-09 16:02 Christoph Hellwig [this message]
2023-11-09 16:13 ` [PATCH] repair: fix the call to search_rt_dup_extent in scan_bmapbt Darrick J. Wong
2023-11-09 16:14   ` Christoph Hellwig

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=20231109160233.703566-1-hch@lst.de \
    --to=hch@lst.de \
    --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