Bug 1187952 - dht-common.c GF_XATTR_LOCKINFO_KEY compare done wrongly
Summary: dht-common.c GF_XATTR_LOCKINFO_KEY compare done wrongly
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: porting
Version: mainline
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: bugs@gluster.org
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-01-31 18:20 UTC by Dennis Schafroth
Modified: 2015-05-14 17:45 UTC (History)
3 users (show)

Fixed In Version: glusterfs-3.7.0
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-05-14 17:29:05 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Dennis Schafroth 2015-01-31 18:20:22 UTC
Compiling dht-common.c with shows warnings: 
  CC       dht-common.lo
dht-common.c:2997:57: warning: size argument in 'strncmp' call is a comparison [-Wmemsize-comparison]
                         strlen (GF_XATTR_LOCKINFO_KEY) != 0))) {
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
dht-common.c:2996:17: note: did you mean to compare the result of 'strncmp' instead?
            && (strncmp (key, GF_XATTR_LOCKINFO_KEY,
                ^
dht-common.c:2997:26: note: explicitly cast the argument to size_t to silence this warning
                         strlen (GF_XATTR_LOCKINFO_KEY) != 0))) {
                         ^
                         (size_t)(                          )

I believe that the a parentes is misplaced, so the code is doing 

strncmp(key, GF_XATTR_LOCKINFO_KEY, 0) 

instead of 

strncmp(key, GF_XATTR_LOCKINFO_KEY, strlen(GF_XATTR_LOCKINFO_KEY) )

Comment 1 Anand Avati 2015-01-31 18:24:21 UTC
REVIEW: http://review.gluster.org/9518 (Compare key with GF_XATTR_LOCKINFO_KEY with length of GF_XATTR_LOCKINFO_KEY instead of length of 0) posted (#1) for review on master by Dennis Schafroth (dennis)

Comment 2 Anand Avati 2015-02-02 17:58:59 UTC
REVIEW: http://review.gluster.org/9544 (Compare key with GF_XATTR_LOCKINFO_KEY with length of GF_XATTR_LOCKINFO_KEY instead of length of 1) posted (#1) for review on master by Dennis Schafroth (dennis)

Comment 3 Anand Avati 2015-02-02 20:17:23 UTC
REVIEW: http://review.gluster.org/9518 (Compare key with GF_XATTR_LOCKINFO_KEY with length of GF_XATTR_LOCKINFO_KEY instead of length of 0) posted (#164) for review on master by Vijay Bellur (vbellur)

Comment 4 Anand Avati 2015-02-02 20:17:39 UTC
COMMIT: http://review.gluster.org/9518 committed in master by Vijay Bellur (vbellur) 
------
commit f9e6f25fb5576c0b0cf9377d49c9896fa8278c00
Author: Dennis Schafroth <dennis>
Date:   Sat Jan 31 19:23:16 2015 +0100

    Compare key with GF_XATTR_LOCKINFO_KEY with length of GF_XATTR_LOCKINFO_KEY instead of length of 0
    
    BUG: 1187952
    Change-Id: I0a97c553e85a0f9260ab01d4b48c64831bf67c18
    Signed-off-by: Dennis Schafroth <dennis>
    Reviewed-on: http://review.gluster.org/9518
    Reviewed-by: Joe Julian <joe>
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Pranith Kumar Karampuri <pkarampu>
    Reviewed-by: Raghavendra G <rgowdapp>
    Tested-by: Raghavendra G <rgowdapp>
    Reviewed-by: Vijay Bellur <vbellur>
    Tested-by: Vijay Bellur <vbellur>

Comment 5 Niels de Vos 2015-05-14 17:29:05 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.7.0, please open a new bug report.

glusterfs-3.7.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://thread.gmane.org/gmane.comp.file-systems.gluster.devel/10939
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user

Comment 6 Niels de Vos 2015-05-14 17:35:50 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.7.0, please open a new bug report.

glusterfs-3.7.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://thread.gmane.org/gmane.comp.file-systems.gluster.devel/10939
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user

Comment 7 Niels de Vos 2015-05-14 17:38:11 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.7.0, please open a new bug report.

glusterfs-3.7.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://thread.gmane.org/gmane.comp.file-systems.gluster.devel/10939
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user

Comment 8 Niels de Vos 2015-05-14 17:45:48 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.7.0, please open a new bug report.

glusterfs-3.7.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://thread.gmane.org/gmane.comp.file-systems.gluster.devel/10939
[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.