All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Print less scary message if pvmove already finished.
@ 2011-01-19 22:37 Milan Broz
  2011-01-20 10:34 ` Zdenek Kabelac
  0 siblings, 1 reply; 2+ messages in thread
From: Milan Broz @ 2011-01-19 22:37 UTC (permalink / raw)
  To: lvm-devel

If other process finishes (ar aborts) pvmove operation and
polling function cannot find any lv with PVMOVE flag return
success and do not print  "aborting" message.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=602389
---
 tools/polldaemon.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/tools/polldaemon.c b/tools/polldaemon.c
index aac9c17..fdb3edd 100644
--- a/tools/polldaemon.c
+++ b/tools/polldaemon.c
@@ -193,8 +193,16 @@ static int _wait_for_single_lv(struct cmd_context *cmd, const char *name, const
 			return 0;
 		}
 
-		if (!(lv = parms->poll_fns->get_copy_lv(cmd, vg, name, uuid,
-							parms->lv_type))) {
+		lv = parms->poll_fns->get_copy_lv(cmd, vg, name, uuid, parms->lv_type);
+
+		if (!lv && parms->lv_type == PVMOVE) {
+			log_print("%s: pvmove finished or aborted by other process.",
+				  name);
+			unlock_and_free_vg(cmd, vg, vg->name);
+			return 1;
+		}
+
+		if (!lv) {
 			log_error("ABORTING: Can't find LV in %s for %s",
 				  vg->name, name);
 			unlock_and_free_vg(cmd, vg, vg->name);
-- 
1.7.2.3



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

* [PATCH] Print less scary message if pvmove already finished.
  2011-01-19 22:37 [PATCH] Print less scary message if pvmove already finished Milan Broz
@ 2011-01-20 10:34 ` Zdenek Kabelac
  0 siblings, 0 replies; 2+ messages in thread
From: Zdenek Kabelac @ 2011-01-20 10:34 UTC (permalink / raw)
  To: lvm-devel

Dne 19.1.2011 23:37, Milan Broz napsal(a):
> If other process finishes (ar aborts) pvmove operation and
> polling function cannot find any lv with PVMOVE flag return
> success and do not print  "aborting" message.
> 
> Fixes https://bugzilla.redhat.com/show_bug.cgi?id=602389
> ---
>  tools/polldaemon.c |   12 ++++++++++--
>  1 files changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/polldaemon.c b/tools/polldaemon.c
> index aac9c17..fdb3edd 100644
> --- a/tools/polldaemon.c
> +++ b/tools/polldaemon.c
> @@ -193,8 +193,16 @@ static int _wait_for_single_lv(struct cmd_context *cmd, const char *name, const
>  			return 0;
>  		}
>  
> -		if (!(lv = parms->poll_fns->get_copy_lv(cmd, vg, name, uuid,
> -							parms->lv_type))) {
> +		lv = parms->poll_fns->get_copy_lv(cmd, vg, name, uuid, parms->lv_type);
> +
> +		if (!lv && parms->lv_type == PVMOVE) {
> +			log_print("%s: pvmove finished or aborted by other process.",
> +				  name);
> +			unlock_and_free_vg(cmd, vg, vg->name);
> +			return 1;
> +		}
> +
> +		if (!lv) {
>  			log_error("ABORTING: Can't find LV in %s for %s",
>  				  vg->name, name);
>  			unlock_and_free_vg(cmd, vg, vg->name);


I would move it into the same 'if (!lv)'
and just add a sub if for   if (parms->...) { }


Zdenek



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

end of thread, other threads:[~2011-01-20 10:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-19 22:37 [PATCH] Print less scary message if pvmove already finished Milan Broz
2011-01-20 10:34 ` Zdenek Kabelac

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.