Bug 1451033 - contrib: timer-wheel 32-bit bug, use builtin_fls, license, etc
Summary: contrib: timer-wheel 32-bit bug, use builtin_fls, license, etc
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: core
Version: 3.11
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Kaleb KEITHLEY
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-15 15:36 UTC by Kaleb KEITHLEY
Modified: 2017-05-30 18:52 UTC (History)
1 user (show)

Fixed In Version: glusterfs-3.11.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-05-30 18:52:40 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Kaleb KEITHLEY 2017-05-15 15:36:37 UTC
Description of problem:

It's bad form to remove other people's copyright and license when you copy their source for your own use.

Defining BITS_PER_LONG as 64 is incorrect on 32-bit platforms.

The mismatch between the unsigned long of the timer and the int param to fls() means on 64-bit platforms that any bits set in the high 32-bits of the the timer are lost/ignored.

gf_tw_find_last_bit() is meant to find the last bit in an array of longs. It's overkill for gluster's timerwheel where we only ever pass a single long; replacing it with a direct call to fls() which is renamed to gf_tw_fls()

The timer routines are slightly modified from the kernel timer functions that first appeared circa 2.6.x in .../kernel/timer.c AFAICT.

find_last_bit() comes from the (linux) kernel (.../lib/find_bit.c in 4.x kernels, .../lib/find_last_bit.c in 3.x kernels) but as noted above, it is removed with this patch.

__fls() comes from the linux kernel (.../include/asm-generic/ bitops/{__fls.h,builtin-__fls.h}

Restoring/updating the copyright and license to the version from the 4.x kernel find_bit.c. (timer.c does not have a license, __fls.h and builtin-__fls.h do not have a copyright or license, but the whole kernel is licensed under GPLv2 anyway.)

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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Worker Ant 2017-05-15 15:42:18 UTC
REVIEW: https://review.gluster.org/17301 (contrib/timerwheel: bad 32-bit, use builtin fls(), fix copyright) posted (#1) for review on release-3.11 by Kaleb KEITHLEY (kkeithle)

Comment 2 Worker Ant 2017-05-16 00:36:30 UTC
COMMIT: https://review.gluster.org/17301 committed in release-3.11 by Shyamsundar Ranganathan (srangana) 
------
commit fd34879c6b4a68e514b8f746f52437f367835ea9
Author: Kaleb S. KEITHLEY <kkeithle>
Date:   Mon May 1 12:39:56 2017 -0400

    contrib/timerwheel: bad 32-bit, use builtin fls(), fix copyright
    
    It's bad form to remove other people's copyright and license when you
    copy their source for your own use.
    
    Defining BITS_PER_LONG as 64 is incorrect on 32-bit platforms.
    
    The mismatch between the unsigned long of the timer and the int
    param to fls() means on 64-bit platforms that any bits set in the
    high 32-bits of the the timer are lost/ignored.
    
    gf_tw_find_last_bit() is meant to find the last bit in an array of
    longs. It's overkill for gluster's timerwheel  where we only ever pass
    a single long; replacing it with a direct call to fls() which is
    renamed to gf_tw_fls()
    
    The timer routines are slightly modified from the kernel timer
    functions that first appeared circa 2.6.x in .../kernel/timer.c
    AFAICT.
    
    find_last_bit() comes from the (linux) kernel (.../lib/find_bit.c
    in 4.x kernels, .../lib/find_last_bit.c in 3.x kernels) but as noted
    above, it is removed with this patch.
    
    __fls() comes from the linux kernel (.../include/asm-generic/
    bitops/{__fls.h,builtin-__fls.h}
    
    Restoring/updating the copyright and license to the version from
    the 4.x kernel find_bit.c. (timer.c does not have a license, __fls.h
    and builtin-__fls.h do not have a copyright or license, but the whole
    kernel is licensed under GPLv2 anyway.)
    
      mainline BUG: none
      Master: https://review.gluster.org/17146
    
    Change-Id: I2d2defccf1ccc74f55d99e94212747a36a1dff35
    BUG: 1451033
    Signed-off-by: Kaleb S. KEITHLEY <kkeithle>
    Reviewed-on: https://review.gluster.org/17301
    Smoke: Gluster Build System <jenkins.org>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.org>
    Reviewed-by: Shyamsundar Ranganathan <srangana>

Comment 3 Shyamsundar 2017-05-30 18:52:40 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.