Bug 1433405 - GF_REF_PUT() should return 0 when the structure becomes invalid
Summary: GF_REF_PUT() should return 0 when the structure becomes invalid
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: core
Version: mainline
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Niels de Vos
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-03-17 15:11 UTC by Niels de Vos
Modified: 2017-05-30 18:47 UTC (History)
1 user (show)

Fixed In Version: glusterfs-3.11.0
Clone Of:
Environment:
Last Closed: 2017-05-30 18:47:35 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Niels de Vos 2017-03-17 15:11:46 UTC
Description of problem:
GF_REF_PUT() documents the return value as 0 when the last reference is put. Currently the function returns void. Correct the functions to return the (non) 0 value helps certain potential use-cases (like client_t in protocol/server).

Version-Release number of selected component (if applicable):
all, but only needed when other structures use the generic refcounting

Comment 1 Worker Ant 2017-03-17 15:14:56 UTC
REVIEW: https://review.gluster.org/16910 (refcount: correct the return value of GF_REF_PUT()) posted (#1) for review on master by Niels de Vos (ndevos)

Comment 2 Worker Ant 2017-03-20 22:52:25 UTC
REVIEW: https://review.gluster.org/16910 (refcount: correct the return value of GF_REF_PUT()) posted (#2) for review on master by Niels de Vos (ndevos)

Comment 3 Worker Ant 2017-03-22 01:00:21 UTC
COMMIT: https://review.gluster.org/16910 committed in master by Jeff Darcy (jeff.us) 
------
commit a1d60fe4e9ba46e2f472170e65043f5735af1fd5
Author: Niels de Vos <ndevos>
Date:   Tue Mar 14 15:38:39 2017 +0100

    refcount: correct the return value of GF_REF_PUT()
    
    It is documented that GF_REF_PUT() returns a 0 in case the call resulted
    in free'ing the structure. However the implementations did not have a
    return value, so nothing can actually use it.
    
    Change-Id: Ic57091f5ddd7e0b80929dc335a5b6d37f5fe1b2e
    BUG: 1433405
    Signed-off-by: Niels de Vos <ndevos>
    Reviewed-on: https://review.gluster.org/16910
    Smoke: Gluster Build System <jenkins.org>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.org>
    Reviewed-by: Xavier Hernandez <xhernandez>
    Reviewed-by: Jeff Darcy <jeff.us>
    Reviewed-by: Kaleb KEITHLEY <kkeithle>

Comment 4 Shyamsundar 2017-05-30 18:47:35 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.11.0, please open a new bug report.

glusterfs-3.11.0 has been announced on the Gluster mailinglists [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://lists.gluster.org/pipermail/announce/2017-May/000073.html
[2] https://www.gluster.org/pipermail/gluster-users/


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