xfs/098: fix xfs_repair on newer xfsprogs

1) use _repair_scratch_fs instead of xfs_repair
   The obsolete xfs_repair always cleared the log regardless of
   whether it is corrupted and current xfs_repair only cleared the
   log when -L option is specified.  xfs_repair -L option should be
   used to clear it if xfs_repair failed to clear log.
2) catch non-zero return value instead of 2
   It can be applied to both the old return value 1 and the new
   return value 2
3) add filter_xfs_dmesg to ignore mount related warnings
   If we corrupt log and mount on a CONFIG_XFS_WARN build, there
   will be mount related warnings in dmesg as expected.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
Xiao Yang
2016-09-14 10:52:36 +08:00
committed by Eryu Guan
parent 88d00424cf
commit f4a4c64c29
2 changed files with 16 additions and 2 deletions
+1 -1
View File
@@ -1152,7 +1152,7 @@ _repair_scratch_fs()
xfs)
_scratch_xfs_repair "$@" 2>&1
res=$?
if [ "$res" -eq 2 ]; then
if [ "$res" -ne 0 ]; then
echo "xfs_repair returns $res; replay log?"
_scratch_mount
res=$?