From: Darrick J. Wong Date: Thu, 13 Jan 2022 01:19:03 +0000 (-0800) Subject: xfs_db: fix nbits parameter in fa_ino[48] functions X-Git-Tag: xfsprogs-5.15-fixes_2022-01-19~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=792c7fe0498409dfcff5a79acf8316f7c03fabb6;p=xfsprogs-dev.git xfs_db: fix nbits parameter in fa_ino[48] functions Use the proper macro to convert ino4 and ino8 field byte sizes to a bit count in the functions that navigate shortform directories. This just happens to work correctly for ino4 entries, but omits the upper 4 bytes of an ino8 entry. Note that the entries display correctly; it's just the command "addr u3.sfdir3.list[X].inumber.i8" that won't. Found by running smatch. Signed-off-by: Darrick J. Wong --- diff --git a/db/faddr.c b/db/faddr.c index 81d69c94..0127c5d1 100644 --- a/db/faddr.c +++ b/db/faddr.c @@ -353,7 +353,8 @@ fa_ino4( xfs_ino_t ino; ASSERT(next == TYP_INODE); - ino = (xfs_ino_t)getbitval(obj, bit, bitsz(XFS_INO32_SIZE), BVUNSIGNED); + ino = (xfs_ino_t)getbitval(obj, bit, bitize(XFS_INO32_SIZE), + BVUNSIGNED); if (ino == NULLFSINO) { dbprintf(_("null inode number, cannot set new addr\n")); return; @@ -370,7 +371,8 @@ fa_ino8( xfs_ino_t ino; ASSERT(next == TYP_INODE); - ino = (xfs_ino_t)getbitval(obj, bit, bitsz(XFS_INO64_SIZE), BVUNSIGNED); + ino = (xfs_ino_t)getbitval(obj, bit, bitize(XFS_INO64_SIZE), + BVUNSIGNED); if (ino == NULLFSINO) { dbprintf(_("null inode number, cannot set new addr\n")); return;