Blame SOURCES/xfsprogs-4.5.0-xfs_repair-exit-value-memory.patch

e59f31
xfs_repair: don't mark the fs dirty just because memory possibly be low
e59f31
e59f31
e59f31
e59f31
When I run "xfs_repair -n" on a 500T device with 16G memory,
e59f31
xfs_repair print warning as below:
e59f31
e59f31
  Memory available for repair (11798MB) may not be sufficient.
e59f31
  At least 64048MB is needed to repair this filesystem efficiently
e59f31
  If repair fails due to lack of memory, please
e59f31
  turn prefetching off (-P) to reduce the memory footprint.
e59f31
e59f31
And it return 1 at last. But xfs_repair didn't hit any error, it
e59f31
just feel the memory maybe too low(not real), then return error.
e59f31
There is no reason to mark the fs dirty just because it thinks it
e59f31
might *possibly* be low on memory.
e59f31
e59f31
do_warn() will set fs_is_dirty=1, if we only want to print warning
e59f31
message(not real failure), turn to use do_log() will be better.
e59f31
e59f31
Signed-off-by: Zorro Lang <zlang@redhat.com>
e59f31
---
e59f31
 repair/xfs_repair.c | 6 +++---
e59f31
 1 file changed, 3 insertions(+), 3 deletions(-)
e59f31
e59f31
diff --git a/repair/xfs_repair.c b/repair/xfs_repair.c
e59f31
index 9d91f2d..bbf0edc 100644
e59f31
--- a/repair/xfs_repair.c
e59f31
+++ b/repair/xfs_repair.c
e59f31
@@ -851,16 +851,16 @@ main(int argc, char **argv)
e59f31
 	  "with the -m option. Please increase it to at least %lu.\n"),
e59f31
 					mem_used / 1024);
e59f31
 			}
e59f31
-			do_warn(
e59f31
+			do_log(
e59f31
 	_("Memory available for repair (%luMB) may not be sufficient.\n"
e59f31
 	  "At least %luMB is needed to repair this filesystem efficiently\n"
e59f31
 	  "If repair fails due to lack of memory, please\n"),
e59f31
 				max_mem / 1024, mem_used / 1024);
e59f31
 			if (do_prefetch)
e59f31
-				do_warn(
e59f31
+				do_log(
e59f31
 	_("turn prefetching off (-P) to reduce the memory footprint.\n"));
e59f31
 			else
e59f31
-				do_warn(
e59f31
+				do_log(
e59f31
 	_("increase system RAM and/or swap space to at least %luMB.\n"),
e59f31
 			mem_used * 2 / 1024);
e59f31
 
e59f31
-- 
e59f31
2.5.5
e59f31
e59f31
_______________________________________________
e59f31
xfs mailing list
e59f31
xfs@oss.sgi.com
e59f31
http://oss.sgi.com/mailman/listinfo/xfs
e59f31
e59f31