diff options
author | Roger Willcocks <roger@filmlight.ltd.uk> | 2016-10-20 15:48:38 +1100 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2016-10-20 15:48:38 +1100 |
commit | 8cdcc8102c0cfad20513ed1bfb96e0e9963928a8 (patch) | |
tree | 25f6467ff79b46d176c68b391d315226f9bf2383 /fs/xfs/libxfs/xfs_format.h | |
parent | 58d789678546d46d7bbd809dd7dab417c0f23655 (diff) | |
download | linux-stable-8cdcc8102c0cfad20513ed1bfb96e0e9963928a8.tar.gz linux-stable-8cdcc8102c0cfad20513ed1bfb96e0e9963928a8.tar.bz2 linux-stable-8cdcc8102c0cfad20513ed1bfb96e0e9963928a8.zip |
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.
[Darrick: port to kernel from xfsprogs]
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>
Diffstat (limited to 'fs/xfs/libxfs/xfs_format.h')
-rw-r--r-- | fs/xfs/libxfs/xfs_format.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/fs/xfs/libxfs/xfs_format.h b/fs/xfs/libxfs/xfs_format.h index f6547fc5e016..6b7579e7b60a 100644 --- a/fs/xfs/libxfs/xfs_format.h +++ b/fs/xfs/libxfs/xfs_format.h @@ -865,7 +865,6 @@ typedef struct xfs_timestamp { * padding field for v3 inodes. */ #define XFS_DINODE_MAGIC 0x494e /* 'IN' */ -#define XFS_DINODE_GOOD_VERSION(v) ((v) >= 1 && (v) <= 3) typedef struct xfs_dinode { __be16 di_magic; /* inode magic # = XFS_DINODE_MAGIC */ __be16 di_mode; /* mode and type of file */ |