Bug 890618

Summary: misleading return values of some functions.
Product: [Community] GlusterFS Reporter: Jules Wang <lancelotds>
Component: unclassifiedAssignee: Vijay Bellur <vbellur>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: low Docs Contact:
Priority: unspecified    
Version: mainlineCC: gluster-bugs
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: glusterfs-3.5.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-04-17 11:40:13 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 Jules Wang 2012-12-28 06:28:02 UTC
Description of problem:
return values of some functions are misleading. such as glusterd_is_local_addr

when glusterd_is_local_addr(hostname) returns 0, it means hostname *is* local address.

when someone try to use glusterd_is_local_addr like that:

  if(glusterd_is_local_addr(hostname))
           continue;

he  will probably get a bug. :-(

such as xlators/mgmt/glusterd/src/glusterd-op-sm.c:1659
        if (glusterd_is_local_addr (hostname)) {
                ret = 0;
                goto out;
        }
with the above code, the operation will jump over all the remote hostnames. I am not sure whether this is the author intend to do.

Is there any guidelines about function interface design in glusterfs project?

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


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Jules Wang 2013-01-04 03:46:47 UTC
xlators/mgmt/glusterd/src/glusterd-op-sm.c:1659  is correct. 

I really want to edit my former comment, but it seems that I can not.

Comment 2 Vijay Bellur 2013-01-26 19:39:47 UTC
CHANGE: http://review.gluster.org/4427 (glusterd: make 'glusterd_is_local_addr' return bool) merged in master by Anand Avati (avati)

Comment 3 Jules Wang 2013-01-29 07:24:24 UTC
please set bug status to MODIFIED.

Comment 4 Niels de Vos 2014-04-17 11:40:13 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.5.0, please reopen this bug report.

glusterfs-3.5.0 has been announced on the Gluster Developers mailinglist [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://thread.gmane.org/gmane.comp.file-systems.gluster.devel/6137
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user