On Tue, Nov 19, 2024 at 04:49:48PM +0100, Christoph Hellwig wrote: > Use the proper helpers to deal with sparse rtbno encoding. > > Signed-off-by: Christoph Hellwig <hch@xxxxxx> > --- > fs/xfs/xfs_rtalloc.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c > index 90f4fdd47087..a991b750df81 100644 > --- a/fs/xfs/xfs_rtalloc.c > +++ b/fs/xfs/xfs_rtalloc.c > @@ -1233,13 +1233,13 @@ xfs_rt_check_size( > struct xfs_mount *mp, > xfs_rfsblock_t last_block) > { > - xfs_daddr_t daddr = XFS_FSB_TO_BB(mp, last_block); > + xfs_daddr_t daddr = xfs_rtb_to_daddr(mp, last_block); > struct xfs_buf *bp; > int error; > > - if (XFS_BB_TO_FSB(mp, daddr) != last_block) { > + if (xfs_daddr_to_rtb(mp, daddr) != last_block) { Er... this converts the daddr to a segmented xfs_rtblock_t type, but last_block is a non segmented xfs_rfsblock_t type. You can't compare the two directly. I think the code was correct without this patch. --D > xfs_warn(mp, "RT device size overflow: %llu != %llu", > - XFS_BB_TO_FSB(mp, daddr), last_block); > + xfs_daddr_to_rtb(mp, daddr), last_block); > return -EFBIG; > } > > -- > 2.45.2 > >