Cathy Zhou wrote:
> I am wondering, we should always return ENOENT in 
> dls_devnet_hold_by_name() function [1].
...
 > [1] Probably the only exception is the dls_mgmt_xxx() upcalll. If the
 > daemon fails for some reason, maybe EBADF should be returned.

Hmm, I'm not sure if we want to mask the actual errors from 
dls_mgmt_get_linkid() by always returning either ENOENT.  For example, if 
the upcall failed, the error code should have appropriately been returned 
by i_dls_mgmt_upcall(), and we shouldn't have to translate between one 
error code and another.  If it's ENOMEM, then we'll return that, etc...

EBADF usually means that the caller supplied an invalid file-descriptor, 
so it might be strange to have i_dls_mgmt_upcall() return that error 
code.  Perhaps we need to debug the kinds of errors that 
i_dls_mgmt_upcall() returns separately.

> For example, ln1048, should return ENOENT.

Fixed.

> I am not quite understand 
> when we would reach line 1080, but I can certainly test it out.

I honestly don't know, which is why I left it alone.  I'll change it to 
ENOENT.

> The 
> dls_devnet_set() function on line1105 could return EEXIST, if this is a 
> implicit VLAN name, but the same VLAN already exists using another name, 
> but in that case, we should also return ENOENT.

EEXIST seems appropriate than ENOENT to me in that context.  The user is 
attempting to create a VLAN that already exists.

-Seb

Reply via email to