public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] xfs: Fix calculation of m_rtx_per_rbmblock
@ 2026-01-19 11:46 Nirjhar Roy (IBM)
  2026-01-19 16:05 ` kernel test robot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Nirjhar Roy (IBM) @ 2026-01-19 11:46 UTC (permalink / raw)
  To: linux-xfs; +Cc: ritesh.list, ojaswin, djwong, hch, nirjhar.roy.lists

m_rtx_per_rbmblock of struct xfs_mount should use the function
xfs_rtbitmap_rtx_per_rbmblock() to calculate the number of rt
extents tracked per bitmap file block instead of always
calculating it as mp->m_blockwsize << XFS_NBWORDLOG.
When metadir/rtgroups is enabled, the number of tracked extents
per bitmap file block is slightly less than sizeof(fsblock) in
bits, since some bytes are reserved by struct xfs_rtbuf_blkinfo.

Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com>
---
 fs/xfs/libxfs/xfs_sb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c
index 94c272a2ae26..b2b4d7f21a5d 100644
--- a/fs/xfs/libxfs/xfs_sb.c
+++ b/fs/xfs/libxfs/xfs_sb.c
@@ -1268,7 +1268,7 @@ xfs_sb_mount_common(
 	mp->m_agno_log = xfs_highbit32(sbp->sb_agcount - 1) + 1;
 	mp->m_blockmask = sbp->sb_blocksize - 1;
 	mp->m_blockwsize = xfs_rtbmblock_size(sbp) >> XFS_WORDLOG;
-	mp->m_rtx_per_rbmblock = mp->m_blockwsize << XFS_NBWORDLOG;
+	mp->m_rtx_per_rbmblock = xfs_rtbitmap_rtx_per_rbmblock(mp);
 
 	ags->blocks = mp->m_sb.sb_agblocks;
 	ags->blklog = mp->m_sb.sb_agblklog;
-- 
2.43.5


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

end of thread, other threads:[~2026-01-19 17:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-19 11:46 [PATCH v1] xfs: Fix calculation of m_rtx_per_rbmblock Nirjhar Roy (IBM)
2026-01-19 16:05 ` kernel test robot
2026-01-19 16:29 ` kernel test robot
2026-01-19 17:48 ` Nirjhar Roy (IBM)

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