[lvm-devel] [PATCH 2/8] Add default error path for get_property

Dave Wysochanski dwysocha at redhat.com
Sat Jan 8 22:20:22 UTC 2011


On Fri, 2011-01-07 at 16:03 +0100, Zdenek Kabelac wrote:
> Dne 7.1.2011 14:55, Alasdair G Kergon napsal(a):
> > On Fri, Jan 07, 2011 at 02:49:16PM +0100, Zdenek Kabelac wrote:
> >> No - all parameters passed to get_property are NULL in this case -
> >> so programmer's error.
> >  
> > So in what sense is it invalid?
> > (I'm basically asking if a more-useful error message is possible.
> > So you could say in it the function was called without any parameters set?)
> > 
> 
> Examle of such error use-case could be:
> 
> lv = NULL;
> lvm_lv_get_property(lv, "name");
> 
> i.e. user will use invalid lv handle for some reason - code mistake, missing
> check...
> 
> Maybe "Invalid library use." ?
> 
> Zdenek
> 

Cleanup in this patch looks great.  Ack.

However, some handle validation should be done at the beginning of every
library call (problem not unique to this function), not just in this
function.





More information about the lvm-devel mailing list