[Bugs] [Bug 1451033] New: contrib: timer-wheel 32-bit bug, use builtin_fls, license, etc

bugzilla at redhat.com bugzilla at redhat.com
Mon May 15 15:36:37 UTC 2017


https://bugzilla.redhat.com/show_bug.cgi?id=1451033

            Bug ID: 1451033
           Summary: contrib: timer-wheel 32-bit bug, use builtin_fls,
                    license, etc
           Product: GlusterFS
           Version: 3.11
         Component: core
          Assignee: bugs at gluster.org
          Reporter: kkeithle at redhat.com
                CC: bugs at gluster.org



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:

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.


More information about the Bugs mailing list