linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfs_repair: don't mark the fs dirty just because memory possibly be low
@ 2016-07-01 16:36 Zorro Lang
  2016-07-01 16:43 ` Eric Sandeen
  0 siblings, 1 reply; 2+ messages in thread
From: Zorro Lang @ 2016-07-01 16:36 UTC (permalink / raw)
  To: xfs; +Cc: sandeen, Zorro Lang

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 return 1 at last. But xfs_repair didn't hit any error, it
just feel the memory maybe too low(not real), then return error.
There is no reason to mark the fs dirty just because it thinks it
might *possibly* be low on memory.

do_warn() will set fs_is_dirty=1, if we only want to print warning
message(not real failure), turn to use do_log() will be better.

Signed-off-by: Zorro Lang <zlang@redhat.com>
---
 repair/xfs_repair.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/repair/xfs_repair.c b/repair/xfs_repair.c
index 9d91f2d..bbf0edc 100644
--- a/repair/xfs_repair.c
+++ b/repair/xfs_repair.c
@@ -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);
 
-- 
2.5.5

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] xfs_repair: don't mark the fs dirty just because memory possibly be low
  2016-07-01 16:36 [PATCH] xfs_repair: don't mark the fs dirty just because memory possibly be low Zorro Lang
@ 2016-07-01 16:43 ` Eric Sandeen
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Sandeen @ 2016-07-01 16:43 UTC (permalink / raw)
  To: Zorro Lang, xfs

On 7/1/16 11:36 AM, Zorro Lang wrote:
> 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 return 1 at last. But xfs_repair didn't hit any error, it
> just feel the memory maybe too low(not real), then return error.
> There is no reason to mark the fs dirty just because it thinks it
> might *possibly* be low on memory.
> 
> do_warn() will set fs_is_dirty=1, if we only want to print warning
> message(not real failure), turn to use do_log() will be better.
> 
> Signed-off-by: Zorro Lang <zlang@redhat.com>

Yep, it's interesting that do_warn() has the side effect of changing
the exit status, but it does!

Reviewed-by: Eric Sandeen <sandeen@redhat.com>

> ---
>  repair/xfs_repair.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/repair/xfs_repair.c b/repair/xfs_repair.c
> index 9d91f2d..bbf0edc 100644
> --- a/repair/xfs_repair.c
> +++ b/repair/xfs_repair.c
> @@ -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);
>  
> 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-01 16:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-01 16:36 [PATCH] xfs_repair: don't mark the fs dirty just because memory possibly be low Zorro Lang
2016-07-01 16:43 ` Eric Sandeen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).