From: "Nirjhar Roy (IBM)" <nirjhar.roy.lists@gmail.com>
To: linux-xfs@vger.kernel.org
Cc: ritesh.list@gmail.com, ojaswin@linux.ibm.com, djwong@kernel.org,
hch@infradead.org
Subject: Re: [PATCH v1] xfs: Fix calculation of m_rtx_per_rbmblock
Date: Mon, 19 Jan 2026 23:18:19 +0530 [thread overview]
Message-ID: <d231892c-596c-4185-9683-db20ad442288@gmail.com> (raw)
In-Reply-To: <2e0f36968b112303466c5e07a88c7e9949f769fe.1768822986.git.nirjhar.roy.lists@gmail.com>
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
prev parent reply other threads:[~2026-01-19 17:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
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=d231892c-596c-4185-9683-db20ad442288@gmail.com \
--to=nirjhar.roy.lists@gmail.com \
--cc=djwong@kernel.org \
--cc=hch@infradead.org \
--cc=linux-xfs@vger.kernel.org \
--cc=ojaswin@linux.ibm.com \
--cc=ritesh.list@gmail.com \
/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