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

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