Bug 1476410 - glusterd: code lacks clarity of logic in glusterd_get_quorum_cluster_counts()
glusterd: code lacks clarity of logic in glusterd_get_quorum_cluster_counts()
Status: MODIFIED
Product: GlusterFS
Classification: Community
Component: glusterd (Show other bugs)
mainline
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Michael Adam
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-28 18:46 EDT by Michael Adam
Modified: 2017-07-31 05:28 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Michael Adam 2017-07-28 18:46:34 EDT
This is counter-intuitive:

ret = gf_string2percent (val, &quorum_percentage);
if (!ret)
    ratio = _gf_true;
...

since !ret sounds like failure but ret == 0 signifies success here.
Comment 1 Worker Ant 2017-07-28 18:51:24 EDT
REVIEW: https://review.gluster.org/17912 (glusterd: improve intuitivity of check in glusterd_get_quorum_cluster_counts) posted (#1) for review on master by Michael Adam (obnox@samba.org)
Comment 2 Worker Ant 2017-07-31 05:27:54 EDT
COMMIT: https://review.gluster.org/17912 committed in master by Atin Mukherjee (amukherj@redhat.com) 
------
commit 96b179850d618c99d185ce7bfed5fe96e6cde919
Author: Michael Adam <obnox@samba.org>
Date:   Tue Jun 13 10:16:27 2017 +0200

    glusterd: improve intuitivity of check in glusterd_get_quorum_cluster_counts
    
    More intuitive to check for ret == 0 than !ret here...
    
    Change-Id: I8177a0bc8f266331187f5f2eeefea8a25cfcb30a
    Signed-off-by: Michael Adam <obnox@samba.org>
    BUG: 1476410
    Reviewed-on: https://review.gluster.org/17912
    Smoke: Gluster Build System <jenkins@build.gluster.org>
    Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
    Tested-by: Atin Mukherjee <amukherj@redhat.com>
    CentOS-regression: Gluster Build System <jenkins@build.gluster.org>

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