* [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
* Re: [PATCH v1] xfs: Fix calculation of m_rtx_per_rbmblock
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)
2 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2026-01-19 16:05 UTC (permalink / raw)
To: Nirjhar Roy (IBM), linux-xfs
Cc: llvm, oe-kbuild-all, ritesh.list, ojaswin, djwong, hch,
nirjhar.roy.lists
Hi Nirjhar,
kernel test robot noticed the following build errors:
[auto build test ERROR on xfs-linux/for-next]
[also build test ERROR on linus/master v6.19-rc6 next-20260116]
[cannot apply to riteshharjani/for-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Nirjhar-Roy-IBM/xfs-Fix-calculation-of-m_rtx_per_rbmblock/20260119-195408
base: https://git.kernel.org/pub/scm/fs/xfs/xfs-linux.git for-next
patch link: https://lore.kernel.org/r/2e0f36968b112303466c5e07a88c7e9949f769fe.1768822986.git.nirjhar.roy.lists%40gmail.com
patch subject: [PATCH v1] xfs: Fix calculation of m_rtx_per_rbmblock
config: i386-buildonly-randconfig-002-20260119 (https://download.01.org/0day-ci/archive/20260119/202601192312.dyXO6IrE-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260119/202601192312.dyXO6IrE-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202601192312.dyXO6IrE-lkp@intel.com/
All errors (new ones prefixed by >>):
>> fs/xfs/libxfs/xfs_sb.c:1271:27: error: call to undeclared function 'xfs_rtbitmap_rtx_per_rbmblock'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
1271 | mp->m_rtx_per_rbmblock = xfs_rtbitmap_rtx_per_rbmblock(mp);
| ^
1 error generated.
vim +/xfs_rtbitmap_rtx_per_rbmblock +1271 fs/xfs/libxfs/xfs_sb.c
1245
1246 /*
1247 * xfs_mount_common
1248 *
1249 * Mount initialization code establishing various mount
1250 * fields from the superblock associated with the given
1251 * mount structure.
1252 *
1253 * Inode geometry are calculated in xfs_ialloc_setup_geometry.
1254 */
1255 void
1256 xfs_sb_mount_common(
1257 struct xfs_mount *mp,
1258 struct xfs_sb *sbp)
1259 {
1260 struct xfs_groups *ags = &mp->m_groups[XG_TYPE_AG];
1261
1262 mp->m_agfrotor = 0;
1263 atomic_set(&mp->m_agirotor, 0);
1264 mp->m_maxagi = mp->m_sb.sb_agcount;
1265 mp->m_blkbit_log = sbp->sb_blocklog + XFS_NBBYLOG;
1266 mp->m_blkbb_log = sbp->sb_blocklog - BBSHIFT;
1267 mp->m_sectbb_log = sbp->sb_sectlog - BBSHIFT;
1268 mp->m_agno_log = xfs_highbit32(sbp->sb_agcount - 1) + 1;
1269 mp->m_blockmask = sbp->sb_blocksize - 1;
1270 mp->m_blockwsize = xfs_rtbmblock_size(sbp) >> XFS_WORDLOG;
> 1271 mp->m_rtx_per_rbmblock = xfs_rtbitmap_rtx_per_rbmblock(mp);
1272
1273 ags->blocks = mp->m_sb.sb_agblocks;
1274 ags->blklog = mp->m_sb.sb_agblklog;
1275 ags->blkmask = xfs_mask32lo(mp->m_sb.sb_agblklog);
1276
1277 xfs_sb_mount_rextsize(mp, sbp);
1278
1279 mp->m_alloc_mxr[0] = xfs_allocbt_maxrecs(mp, sbp->sb_blocksize, true);
1280 mp->m_alloc_mxr[1] = xfs_allocbt_maxrecs(mp, sbp->sb_blocksize, false);
1281 mp->m_alloc_mnr[0] = mp->m_alloc_mxr[0] / 2;
1282 mp->m_alloc_mnr[1] = mp->m_alloc_mxr[1] / 2;
1283
1284 mp->m_bmap_dmxr[0] = xfs_bmbt_maxrecs(mp, sbp->sb_blocksize, true);
1285 mp->m_bmap_dmxr[1] = xfs_bmbt_maxrecs(mp, sbp->sb_blocksize, false);
1286 mp->m_bmap_dmnr[0] = mp->m_bmap_dmxr[0] / 2;
1287 mp->m_bmap_dmnr[1] = mp->m_bmap_dmxr[1] / 2;
1288
1289 mp->m_rmap_mxr[0] = xfs_rmapbt_maxrecs(mp, sbp->sb_blocksize, true);
1290 mp->m_rmap_mxr[1] = xfs_rmapbt_maxrecs(mp, sbp->sb_blocksize, false);
1291 mp->m_rmap_mnr[0] = mp->m_rmap_mxr[0] / 2;
1292 mp->m_rmap_mnr[1] = mp->m_rmap_mxr[1] / 2;
1293
1294 mp->m_rtrmap_mxr[0] = xfs_rtrmapbt_maxrecs(mp, sbp->sb_blocksize, true);
1295 mp->m_rtrmap_mxr[1] = xfs_rtrmapbt_maxrecs(mp, sbp->sb_blocksize, false);
1296 mp->m_rtrmap_mnr[0] = mp->m_rtrmap_mxr[0] / 2;
1297 mp->m_rtrmap_mnr[1] = mp->m_rtrmap_mxr[1] / 2;
1298
1299 mp->m_refc_mxr[0] = xfs_refcountbt_maxrecs(mp, sbp->sb_blocksize, true);
1300 mp->m_refc_mxr[1] = xfs_refcountbt_maxrecs(mp, sbp->sb_blocksize, false);
1301 mp->m_refc_mnr[0] = mp->m_refc_mxr[0] / 2;
1302 mp->m_refc_mnr[1] = mp->m_refc_mxr[1] / 2;
1303
1304 mp->m_rtrefc_mxr[0] = xfs_rtrefcountbt_maxrecs(mp, sbp->sb_blocksize,
1305 true);
1306 mp->m_rtrefc_mxr[1] = xfs_rtrefcountbt_maxrecs(mp, sbp->sb_blocksize,
1307 false);
1308 mp->m_rtrefc_mnr[0] = mp->m_rtrefc_mxr[0] / 2;
1309 mp->m_rtrefc_mnr[1] = mp->m_rtrefc_mxr[1] / 2;
1310
1311 mp->m_bsize = XFS_FSB_TO_BB(mp, 1);
1312 mp->m_alloc_set_aside = xfs_alloc_set_aside(mp);
1313 mp->m_ag_max_usable = xfs_alloc_ag_max_usable(mp);
1314 }
1315
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] xfs: Fix calculation of m_rtx_per_rbmblock
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)
2 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2026-01-19 16:29 UTC (permalink / raw)
To: Nirjhar Roy (IBM), linux-xfs
Cc: oe-kbuild-all, ritesh.list, ojaswin, djwong, hch,
nirjhar.roy.lists
Hi Nirjhar,
kernel test robot noticed the following build errors:
[auto build test ERROR on xfs-linux/for-next]
[also build test ERROR on linus/master v6.19-rc6 next-20260116]
[cannot apply to riteshharjani/for-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Nirjhar-Roy-IBM/xfs-Fix-calculation-of-m_rtx_per_rbmblock/20260119-195408
base: https://git.kernel.org/pub/scm/fs/xfs/xfs-linux.git for-next
patch link: https://lore.kernel.org/r/2e0f36968b112303466c5e07a88c7e9949f769fe.1768822986.git.nirjhar.roy.lists%40gmail.com
patch subject: [PATCH v1] xfs: Fix calculation of m_rtx_per_rbmblock
config: riscv-randconfig-001-20260119 (https://download.01.org/0day-ci/archive/20260120/202601200031.0j1vAGWr-lkp@intel.com/config)
compiler: riscv64-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260120/202601200031.0j1vAGWr-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202601200031.0j1vAGWr-lkp@intel.com/
All errors (new ones prefixed by >>):
fs/xfs/libxfs/xfs_sb.c: In function 'xfs_sb_mount_common':
>> fs/xfs/libxfs/xfs_sb.c:1271:27: error: implicit declaration of function 'xfs_rtbitmap_rtx_per_rbmblock'; did you mean 'xfs_rtx_to_rbmblock'? [-Werror=implicit-function-declaration]
mp->m_rtx_per_rbmblock = xfs_rtbitmap_rtx_per_rbmblock(mp);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfs_rtx_to_rbmblock
cc1: some warnings being treated as errors
vim +1271 fs/xfs/libxfs/xfs_sb.c
1245
1246 /*
1247 * xfs_mount_common
1248 *
1249 * Mount initialization code establishing various mount
1250 * fields from the superblock associated with the given
1251 * mount structure.
1252 *
1253 * Inode geometry are calculated in xfs_ialloc_setup_geometry.
1254 */
1255 void
1256 xfs_sb_mount_common(
1257 struct xfs_mount *mp,
1258 struct xfs_sb *sbp)
1259 {
1260 struct xfs_groups *ags = &mp->m_groups[XG_TYPE_AG];
1261
1262 mp->m_agfrotor = 0;
1263 atomic_set(&mp->m_agirotor, 0);
1264 mp->m_maxagi = mp->m_sb.sb_agcount;
1265 mp->m_blkbit_log = sbp->sb_blocklog + XFS_NBBYLOG;
1266 mp->m_blkbb_log = sbp->sb_blocklog - BBSHIFT;
1267 mp->m_sectbb_log = sbp->sb_sectlog - BBSHIFT;
1268 mp->m_agno_log = xfs_highbit32(sbp->sb_agcount - 1) + 1;
1269 mp->m_blockmask = sbp->sb_blocksize - 1;
1270 mp->m_blockwsize = xfs_rtbmblock_size(sbp) >> XFS_WORDLOG;
> 1271 mp->m_rtx_per_rbmblock = xfs_rtbitmap_rtx_per_rbmblock(mp);
1272
1273 ags->blocks = mp->m_sb.sb_agblocks;
1274 ags->blklog = mp->m_sb.sb_agblklog;
1275 ags->blkmask = xfs_mask32lo(mp->m_sb.sb_agblklog);
1276
1277 xfs_sb_mount_rextsize(mp, sbp);
1278
1279 mp->m_alloc_mxr[0] = xfs_allocbt_maxrecs(mp, sbp->sb_blocksize, true);
1280 mp->m_alloc_mxr[1] = xfs_allocbt_maxrecs(mp, sbp->sb_blocksize, false);
1281 mp->m_alloc_mnr[0] = mp->m_alloc_mxr[0] / 2;
1282 mp->m_alloc_mnr[1] = mp->m_alloc_mxr[1] / 2;
1283
1284 mp->m_bmap_dmxr[0] = xfs_bmbt_maxrecs(mp, sbp->sb_blocksize, true);
1285 mp->m_bmap_dmxr[1] = xfs_bmbt_maxrecs(mp, sbp->sb_blocksize, false);
1286 mp->m_bmap_dmnr[0] = mp->m_bmap_dmxr[0] / 2;
1287 mp->m_bmap_dmnr[1] = mp->m_bmap_dmxr[1] / 2;
1288
1289 mp->m_rmap_mxr[0] = xfs_rmapbt_maxrecs(mp, sbp->sb_blocksize, true);
1290 mp->m_rmap_mxr[1] = xfs_rmapbt_maxrecs(mp, sbp->sb_blocksize, false);
1291 mp->m_rmap_mnr[0] = mp->m_rmap_mxr[0] / 2;
1292 mp->m_rmap_mnr[1] = mp->m_rmap_mxr[1] / 2;
1293
1294 mp->m_rtrmap_mxr[0] = xfs_rtrmapbt_maxrecs(mp, sbp->sb_blocksize, true);
1295 mp->m_rtrmap_mxr[1] = xfs_rtrmapbt_maxrecs(mp, sbp->sb_blocksize, false);
1296 mp->m_rtrmap_mnr[0] = mp->m_rtrmap_mxr[0] / 2;
1297 mp->m_rtrmap_mnr[1] = mp->m_rtrmap_mxr[1] / 2;
1298
1299 mp->m_refc_mxr[0] = xfs_refcountbt_maxrecs(mp, sbp->sb_blocksize, true);
1300 mp->m_refc_mxr[1] = xfs_refcountbt_maxrecs(mp, sbp->sb_blocksize, false);
1301 mp->m_refc_mnr[0] = mp->m_refc_mxr[0] / 2;
1302 mp->m_refc_mnr[1] = mp->m_refc_mxr[1] / 2;
1303
1304 mp->m_rtrefc_mxr[0] = xfs_rtrefcountbt_maxrecs(mp, sbp->sb_blocksize,
1305 true);
1306 mp->m_rtrefc_mxr[1] = xfs_rtrefcountbt_maxrecs(mp, sbp->sb_blocksize,
1307 false);
1308 mp->m_rtrefc_mnr[0] = mp->m_rtrefc_mxr[0] / 2;
1309 mp->m_rtrefc_mnr[1] = mp->m_rtrefc_mxr[1] / 2;
1310
1311 mp->m_bsize = XFS_FSB_TO_BB(mp, 1);
1312 mp->m_alloc_set_aside = xfs_alloc_set_aside(mp);
1313 mp->m_ag_max_usable = xfs_alloc_ag_max_usable(mp);
1314 }
1315
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] xfs: Fix calculation of m_rtx_per_rbmblock
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)
2 siblings, 0 replies; 4+ messages in thread
From: Nirjhar Roy (IBM) @ 2026-01-19 17:48 UTC (permalink / raw)
To: linux-xfs; +Cc: ritesh.list, ojaswin, djwong, hch
On 1/19/26 17:16, Nirjhar Roy (IBM) wrote:
> 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);
Okay, so there are some build failures with this change (reported by
kernel test robot). It looks like xfs_rtbitmap_rtx_per_rbmblock() gets
conditionally compiled and xfs_rtbmblock_size() takes care of the
metadir enable/disablement. I will keep the present code unchanged and
cancel this patch.
--NR
>
> ags->blocks = mp->m_sb.sb_agblocks;
> ags->blklog = mp->m_sb.sb_agblklog;
--
Nirjhar Roy
Linux Kernel Developer
IBM, Bangalore
^ permalink raw reply [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