Skip to contentSkip to conversation

Print less scary message if pvmove already finished.

PATCH New Milan Broz 2 participants 2 messages Jan 19, 2011 – Jan 20, 2011

lore
Share & tools
lore

Milan Broz

author
#0 lore raw

PATCH 1/1 Print less scary message if pvmove already finished.

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(-)
tools/polldaemon.c +10 -2
index aac9c17..fdb3edd 100644
@@ -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);
Signature · 1 line
1.7.2.3
#1 lore raw

PATCH 1/1 Print less scary message if pvmove already finished.

Dne 19.1.2011 23:37, Milan Broz napsal(a):

Quoted 22 lines

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(-)
tools/polldaemon.c +3 -2
index aac9c17..fdb3edd 100644
@@ -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) {

tools/polldaemon.c static int _wait_for_single_lv(struct cmd_context *cmd, const char *name, const · line 208

Quoted 10 lines
tools/polldaemon.c +7 -0
+			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