]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libxfs: use correct rtx count to block count conversion
authorDarrick J. Wong <djwong@kernel.org>
Thu, 21 Nov 2024 00:24:27 +0000 (16:24 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 24 Dec 2024 02:01:32 +0000 (18:01 -0800)
Fix a place where we use the wrong conversion functions to convert
between a number of rt extents and a number of rt blocks.  This isn't
really necessary since userspace cannot allocate rt extents, but let's
not leave a logic bomb.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
libxfs/trans.c

index 01834eff4b77cae1376d2904750dadd24ff956bf..5c896ba1661b10d6c04b19381e4fec012f06bc9e 100644 (file)
@@ -1202,7 +1202,7 @@ libxfs_trans_alloc_inode(
        int                     error;
 
        error = libxfs_trans_alloc(mp, resv, dblocks,
-                       xfs_rtb_to_rtx(mp, rblocks),
+                       xfs_extlen_to_rtxlen(mp, rblocks),
                        force ? XFS_TRANS_RESERVE : 0, &tp);
        if (error)
                return error;