Skip to contentSkip to conversation

LVM2/tools pvremove.c

PATCH [email protected] 2 participants 2 messages Mar 1, 2012 – Mar 2, 2012

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac at sourceware.org 2012-03-01 21:46:31

Modified files:
tools : pvremove.c

Log message:
Replace goto with just log_debug

FIXME: temporal quick hack to make things green There might be a better reaction.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvremove.c.diff?cvsroot=lvm2&r1=1.38&r2=1.39

tools/pvremove.c +1 -1
@@ -129,7 +129,7 @@
 	}
 
 	if (!lvmetad_pv_gone(dev->dev))
-		goto_out;
+		log_debug("PV gone"); /* FIXME any better idea */
 
 	log_print("Labels on physical volume \"%s\" successfully wiped",
 		  pv_name);
#1 lore raw
Quoted 3 lines · zkabelac at sourceware.org

Replace goto with just log_debug
FIXME: temporal quick hack to make things green There might be a better reaction.

The problem here is that this code is not distinguishing between a successful communication with the daemon but with a reply that indicates the device is unknown - which is an error we can ignore - and a failure in the code trying to communicate with the daemon - which should give log_error.

The second case is more important to know about than the first so until the code can distinguish, failing with an error should take precedence.

IOW the 'reason' the daemon gives needs checking, or else it could return something like 'not_found' rather than 'failed' so the caller can decide whether that's OK or not.

(Other parts of the code may need a similar change. Older LVM2 lookup code knows that 'not found' is not necessarily an error and it depends on the context.)

Alasdair