Bug 1095511 - glusterd_xfer_cli_probe_resp() mixes errno and other error codes
Summary: glusterd_xfer_cli_probe_resp() mixes errno and other error codes
Keywords:
Status: CLOSED EOL
Alias: None
Product: GlusterFS
Classification: Community
Component: cli
Version: pre-release
Hardware: All
OS: All
unspecified
unspecified
Target Milestone: ---
Assignee: bugs@gluster.org
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-05-07 21:57 UTC by Wim Lewis
Modified: 2015-10-22 15:40 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-10-22 15:40:20 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.