Bug 1187952 - dht-common.c GF_XATTR_LOCKINFO_KEY compare done wrongly
dht-common.c GF_XATTR_LOCKINFO_KEY compare done wrongly
Status: CLOSED CURRENTRELEASE
Product: GlusterFS
Classification: Community
Component: porting (Show other bugs)
mainline
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: bugs@gluster.org
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-01-31 13:20 EST by Dennis Schafroth
Modified: 2015-05-14 13:45 EDT (History)
3 users (show)

See Also:
Fixed In Version: glusterfs-3.7.0
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-05-14 13:29:05 EDT
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 Dennis Schafroth 2015-01-31 13:20:22 EST
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 13:24:21 EST
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@schafroth.com)
Comment 2 Anand Avati 2015-02-02 12:58:59 EST
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@schafroth.com)
Comment 3 Anand Avati 2015-02-02 15:17:23 EST
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@redhat.com)
Comment 4 Anand Avati 2015-02-02 15:17:39 EST
COMMIT: http://review.gluster.org/9518 committed in master by Vijay Bellur (vbellur@redhat.com) 
------
commit f9e6f25fb5576c0b0cf9377d49c9896fa8278c00
Author: Dennis Schafroth <dennis@schafroth.dk>
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@schafroth.com>
    Reviewed-on: http://review.gluster.org/9518
    Reviewed-by: Joe Julian <joe@julianfamily.org>
    Tested-by: Gluster Build System <jenkins@build.gluster.com>
    Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
    Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
    Tested-by: Raghavendra G <rgowdapp@redhat.com>
    Reviewed-by: Vijay Bellur <vbellur@redhat.com>
    Tested-by: Vijay Bellur <vbellur@redhat.com>
Comment 5 Niels de Vos 2015-05-14 13:29:05 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.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 13:35:50 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.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 13:38:11 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.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 13:45:48 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.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.