[PATCH] v3 inodes are only valid on crc-enabled filesystems.
Roger Willcocks
roger at filmlight.ltd.uk
Sun Aug 16 06:34:10 CDT 2015
On 16 Aug 2015, at 01:42, Dave Chinner <david at fromorbit.com> wrote:
> On Sun, Aug 16, 2015 at 01:14:55AM +0100, Roger Willcocks wrote:
>> Fix an xfs_repair regression reported by Leslie Rhorer where a bad
>> (v3) inode version number was not reset.
>>
>> Signed-off-by: Roger Willcocks <roger at filmlight.ltd.uk>
>>
>> -#define XFS_DINODE_GOOD_VERSION(v) ((v) >= 1 && (v) <= 3)
>> +#define XFS_DINODE_GOOD_VERSION(sb, v) \
>> + (xfs_sb_version_hascrc(sb) ? ((v) == 3) : ((v) == 1 || (v) == 2))
>
> I'd make this a static inline function so it gets type checking and
> it is easier to understand the logic at a glance. i.e. something
> like:
>
> static inline bool
> xfs_dinode_good_version(struct xfs_mount *mp, __uint8_t version)
> {
> if (version < 1 || version > 3)
> return false;
> if (xfs_sb_version_hascrc(&mp->m_sb)) {
> if (version != 3)
> return false;
> } else if (version > 2)
> return false;
>
> return true;
> }
>
include of xfs_dinode.h has to be moved to after the definition of
xfs_mount in libxfs.h, but that’s okay following the pattern set by
xfs_da_format.h.
Updated patch follows.
—
Roger
More information about the xfs
mailing list