Bug 1095511

Summary: glusterd_xfer_cli_probe_resp() mixes errno and other error codes
Product: [Community] GlusterFS Reporter: Wim Lewis <wiml>
Component: cliAssignee: bugs <bugs>
Status: CLOSED EOL QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: pre-releaseCC: bugs, gluster-bugs
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-10-22 15:40:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Wim Lewis 2014-05-07 21:57:46 UTC
Description of problem:

The op_errno argument to glusterd_xfer_cli_probe_resp(), and therefore also to set_probe_error_str(), can contain either a gluster error code (gf_probe_resp/gf_deprobe_resp enums) or a system error code (from errno.h). The ranges of these values overlap (both are small positive integers) which makes it hard to improve the gluster cli tool's error messages.


Version-Release number of selected component (if applicable):

current git head (a05c579)

Actual results:

The value that ends up in the op_errno argument is sometimes a constant like GF_PROBE_QUORUM_NOT_MET, sometimes a constant like ENOTCONN, and sometimes the field rsp.op_errno. The field rsp.op_errno, likewise, is sometimes a gluster error code, sometimes an errno constant, and sometimes the system errno. There doesn't seem to be a way to figure out which it is from context.

Expected results:

set_probe_error_str() should be given enough information that it can provide an accurate error message, but it isn't.

Additional info:

I was originally trying to put together a patch to fix the common, but unhelpful, "Probe returned with unknown errno 107" error message, but ended up going down this rabbit hole of ambiguous error codes...

Ideally, variables holding a system errno should be of type 'int', since that's the type of the errno variable, the argument to strerror(), etc.

Comment 1 Kaleb KEITHLEY 2015-10-22 15:40:20 UTC
pre-release version is ambiguous and about to be removed as a choice.

If you believe this is still a bug, please change the status back to NEW and choose the appropriate, applicable version for it.