]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
libxfs: limit superblock corruption errors to actual corruption
authorDave Chinner <dchinner@redhat.com>
Thu, 6 Mar 2014 23:25:12 +0000 (10:25 +1100)
committerDave Chinner <david@fromorbit.com>
Thu, 6 Mar 2014 23:25:12 +0000 (10:25 +1100)
commitba5027e0fb4a3fb050458ef8ca68cac2c670cf29
treeb6b7ef55acdca79c770bb97d77f4bcfb9d034070
parentc13fe77eac2f91c4b06a327594003b32e4e12f7e
libxfs: limit superblock corruption errors to actual corruption

[userspace port]

Today, if

xfs_sb_read_verify
  xfs_sb_verify
    xfs_mount_validate_sb

detects superblock corruption, it'll be extremely noisy, dumping
2 stacks, 2 hexdumps, etc.

This is because we call XFS_CORRUPTION_ERROR in xfs_mount_validate_sb
as well as in xfs_sb_read_verify.

Also, *any* errors in xfs_mount_validate_sb which are not corruption
per se; things like too-big-blocksize, bad version, bad magic, v1 dirs,
rw-incompat etc - things which do not return EFSCORRUPTED - will
still do the whole XFS_CORRUPTION_ERROR spew when xfs_sb_read_verify
sees any error at all.  And it suggests to the user that they
should run xfs_repair, even if the root cause of the mount failure
is a simple incompatibility.

I'll submit that the probably-not-corrupted errors don't warrant
this much noise, so this patch removes the warning for anything
other than EFSCORRUPTED returns, and replaces the lower-level
XFS_CORRUPTION_ERROR with an xfs_notice().

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