[lvm-devel] LVM2/tools pvremove.c

Alasdair G Kergon agk at redhat.com
Fri Mar 2 02:31:30 UTC 2012


On Thu, Mar 01, 2012 at 09:46:32PM -0000, zkabelac at sourceware.org wrote:
> 	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




More information about the lvm-devel mailing list