Bug 890618 - misleading return values of some functions.
misleading return values of some functions.
Product: GlusterFS
Classification: Community
Component: unclassified (Show other bugs)
x86_64 Linux
unspecified Severity low
: ---
: ---
Assigned To: Vijay Bellur
Depends On:
  Show dependency treegraph
Reported: 2012-12-28 01:28 EST by Jules Wang
Modified: 2014-04-17 07:40 EDT (History)
1 user (show)

See Also:
Fixed In Version: glusterfs-3.5.0
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-04-17 07:40:13 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jules Wang 2012-12-28 01:28:02 EST
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:


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:
Actual results:

Expected results:

Additional info:
Comment 1 Jules Wang 2013-01-03 22:46:47 EST
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 14:39:47 EST
CHANGE: http://review.gluster.org/4427 (glusterd: make 'glusterd_is_local_addr' return bool) merged in master by Anand Avati (avati@redhat.com)
Comment 3 Jules Wang 2013-01-29 02:24:24 EST
please set bug status to MODIFIED.
Comment 4 Niels de Vos 2014-04-17 07:40:13 EDT
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

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