]> www.infradead.org Git - users/hch/xfsprogs.git/commit
xfs_db: pass the inode cluster offset when copying inodes
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 8 Sep 2016 00:22:28 +0000 (10:22 +1000)
committerDave Chinner <david@fromorbit.com>
Thu, 8 Sep 2016 00:22:28 +0000 (10:22 +1000)
commit752ae76b3996b329e7c4893f6231543ef4bc68a9
tree24de0b57a7267dcf8686a77fc702236bf7bbf83c
parent6761d5a4e2831dd08bc9f9b9f592a99468ea426f
xfs_db: pass the inode cluster offset when copying inodes

In copy_inode_chunk, we try to determine whether or not an inode is
free as part of copying the inode records.  The macros involved in
testing ir_free require both the inode record and the offset of an
inode within that chunk.  Prior to sparse inode support, the loop
index "i" was also the inode chunk offset; however, when sparse
support was added, "i" became the inode offset within a cluster and
"ioff" became the inode cluster offset within an inode chunk.
Therefore, it is necessary to pass "ioff + i" to do the free-ness
calculation correctly.

This was discovered while trying to take metadumps of fs images for
scrub testing.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
db/metadump.c