]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_db: use correct inode to set inode type
authorZorro Lang <zlang@redhat.com>
Mon, 17 Aug 2020 21:20:17 +0000 (17:20 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Mon, 17 Aug 2020 21:20:17 +0000 (17:20 -0400)
commitb1a48c4fe86624e7d41539e48e7f86e9492ae151
treedfa65e5d3ebb8d61a8f2f33465d34fdf3276ec27
parent64989ff385e55fd959c58074739bb00617c891df
xfs_db: use correct inode to set inode type

A test fails as:
  # xfs_db -c "inode 133" -c "addr" -c "p core.size" -c "type inode" -c "addr" -c "p core.size" /dev/sdb1
  current
          byte offset 68096, length 512
          buffer block 128 (fsbno 16), 32 bbs
          inode 133, dir inode -1, type inode
  core.size = 123142
  current
          byte offset 65536, length 512
          buffer block 128 (fsbno 16), 32 bbs
          inode 128, dir inode 128, type inode
  core.size = 42

The "type inode" command accidentally moves the io cursor because it
forgets to include the io cursor's buffer offset when it computes the
inode number from the io cursor's location.

Fixes: 533d1d229a88 ("xfs_db: properly set inode type")
Reported-by: Jianhong Yin <jiyin@redhat.com>
Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
db/io.c