]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit - libxfs/xfs_sb.c
libxfs: be more forgiving of a v4 secondary sb w/ junk in v5 fields
authorDave Chinner <dchinner@redhat.com>
Thu, 6 Mar 2014 23:24:33 +0000 (10:24 +1100)
committerDave Chinner <david@fromorbit.com>
Thu, 6 Mar 2014 23:24:33 +0000 (10:24 +1100)
commit46ea3a62bcbedcea2d30eda8fb4ac435e96fd8db
tree27d4b9382a6ee2484a90bceff190f67e38bc5999
parent48733b2d340b953f58a3b6a03fde874ebe0a724d
libxfs: be more forgiving of a v4 secondary sb w/ junk in v5 fields

[userspace port]

Today, if xfs_sb_read_verify encounters a v4 superblock
with junk past v4 fields which includes data in sb_crc,
it will be treated as a failing checksum and a significant
corruption.

There are known prior bugs which leave junk at the end
of the V4 superblock; we don't need to actually fail the
verification in this case if other checks pan out ok.

So if this is a secondary superblock, and the primary
superblock doesn't indicate that this is a V5 filesystem,
don't treat this as an actual checksum failure.

We should probably check the garbage condition as
we do in xfs_repair, and possibly warn about it
or self-heal, but that's a different scope of work.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
libxfs/xfs_sb.c