]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_repair: low memory shouldn't indicate corruption on exit
authorZorro Lang <zlang@redhat.com>
Wed, 20 Jul 2016 05:31:18 +0000 (15:31 +1000)
committerDave Chinner <david@fromorbit.com>
Wed, 20 Jul 2016 05:31:18 +0000 (15:31 +1000)
When I run "xfs_repair -n" on a 500T device with 16G memory,
xfs_repair print warning as below:

  Memory available for repair (11798MB) may not be sufficient.
  At least 64048MB is needed to repair this filesystem efficiently
  If repair fails due to lack of memory, please
  turn prefetching off (-P) to reduce the memory footprint.

And it returned an exit value of 1. But xfs_repair didn't hit any
error, so there is no reason to mark the fs as corrupted just
because it thinks it might *possibly* not have enough memory to run
to completion.

do_warn() will set fs_is_dirty=1 and hence give a non-zero exit
status. If we only want to print an informational message (not a
real issue), then we should use do_log() instead.

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
repair/xfs_repair.c

index 9d91f2df57382618efb573c4993c3481c7eb2aa9..bbf0edc0e1b90dc2fa9870353724e0b6fcbf2d75 100644 (file)
@@ -851,16 +851,16 @@ main(int argc, char **argv)
          "with the -m option. Please increase it to at least %lu.\n"),
                                        mem_used / 1024);
                        }
-                       do_warn(
+                       do_log(
        _("Memory available for repair (%luMB) may not be sufficient.\n"
          "At least %luMB is needed to repair this filesystem efficiently\n"
          "If repair fails due to lack of memory, please\n"),
                                max_mem / 1024, mem_used / 1024);
                        if (do_prefetch)
-                               do_warn(
+                               do_log(
        _("turn prefetching off (-P) to reduce the memory footprint.\n"));
                        else
-                               do_warn(
+                               do_log(
        _("increase system RAM and/or swap space to at least %luMB.\n"),
                        mem_used * 2 / 1024);