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

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