]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
libxfs: v3 inodes are only valid on crc-enabled filesystems
authorRoger Willcocks <roger@filmlight.ltd.uk>
Tue, 18 Aug 2015 07:53:18 +0000 (17:53 +1000)
committerDave Chinner <david@fromorbit.com>
Tue, 18 Aug 2015 07:53:18 +0000 (17:53 +1000)
commit307ae950647d7db413c8e05dc17eb6aca9ef35d2
tree88ad4bea53fba2b58320df8101c3812fa064863d
parent6f9377f07c3a3b8414e122146c1ac8ad85dd185c
libxfs: v3 inodes are only valid on crc-enabled filesystems

xfs_repair was not detecting that version 3 inodes are invalid for
for non-CRC filesystems. The result is specific inode corruptions go
undetected and hence aren't repaired if only the version number is
out of range.

The core of the problem is that the XFS_DINODE_GOOD_VERSION() macro
doesn't know that valid inode versions are dependent on a superblock
version number. Fix this in libxfs, and propagate the new function
out into the rest of xfsprogs to fix the issue.

[dchinner: forward port from 3.2.4 to 4.2.0-rc1, move
xfs_dinode_good_version() to libxfs/xfs_inode-buf.c with all the
other dinode validation functions. ]

Reported-by: Leslie Rhorer <lrhorer@mygrande.net>
Signed-off-by: Roger Willcocks <roger@filmlight.ltd.uk>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
db/check.c
libxfs/xfs_format.h
libxfs/xfs_inode_buf.c
libxfs/xfs_inode_buf.h
repair/dinode.c
repair/prefetch.c