openzfs / spl

A shim layer which adds the core interfaces required for OpenZFS.
https://zfsonlinux.org/
GNU General Public License v2.0
282 stars 181 forks source link

Build failure kernel 4.15rc2 #670

Closed greg-hydrogen closed 6 years ago

greg-hydrogen commented 6 years ago

Hello Everyone,

During compilation on Fedora 27 with kernel 4.15rc2 I receive the following build error:

tmp/spl-build-greg-SLJ5iBLw/BUILD/spl-kmod-0.7.0/_kmod_build_4.15.0-rc2/../spl-0.7.0/module/spl/spl-taskq.c: In function 'taskq_dispatch': /tmp/spl-build-greg-SLJ5iBLw/BUILD/spl-kmod-0.7.0/_kmod_build_4.15.0-rc2/../spl-0.7.0/module/spl/spl-taskq.c:584:16: error: 'struct timer_list' has no member named 'data' t->tqent_timer.data = 0; ^ /tmp/spl-build-greg-SLJ5iBLw/BUILD/spl-kmod-0.7.0/_kmod_build_4.15.0-rc2/../spl-0.7.0/module/spl/spl-taskq.c: In function 'taskq_dispatch_delay': /tmp/spl-build-greg-SLJ5iBLw/BUILD/spl-kmod-0.7.0/_kmod_build_4.15.0-rc2/../spl-0.7.0/module/spl/spl-taskq.c:634:16: error: 'struct timer_list' has no member named 'data' t->tqent_timer.data = (unsigned long)t; ^ /tmp/spl-build-greg-SLJ5iBLw/BUILD/spl-kmod-0.7.0/_kmod_build_4.15.0-rc2/../spl-0.7.0/module/spl/spl-taskq.c:635:26: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types] t->tqent_timer.function = task_expire; ^ /tmp/spl-build-greg-SLJ5iBLw/BUILD/spl-kmod-0.7.0/_kmod_build_4.15.0-rc2/../spl-0.7.0/module/spl/spl-taskq.c: In function 'taskq_init_ent': /tmp/spl-build-greg-SLJ5iBLw/BUILD/spl-kmod-0.7.0/_kmod_build_4.15.0-rc2/../spl-0.7.0/module/spl/spl-taskq.c:726:2: error: implicit declaration of function 'init_timer'; did you mean 'init_timers'? [-Werror=implicit-function-declaration] init_timer(&t->tqent_timer);

The following error was fixed for VirtualBox for kernel 4.15 the struct timer_list' has no member named 'data' this was patched with the following patch located here https://www.virtualbox.org/pipermail/vbox-dev/2017-December/014879.html

if this helps at all

Thanks, Greg

Serphentas commented 6 years ago

Hey,

You can see that the latest ZFS release supports kernels 2.6.32 - 4.13. Hence, I would suggest not to use other kernels for SPL too.

ghost commented 6 years ago

he is simply reporting a break in current unstable kernel in the proper place, this is where the unstable code resides on the issues section.

he is not complaining about stable release on unstable code, hence is right to post it

Btw, I can confirm this breakage on Arch as well using 4.15RC1+ and latest SPL git code, no biggie I have a 4.14 stable to run ZFS

tonyhutter commented 6 years ago

@greg-hydrogen looks like they changed the timer interface (https://lkml.org/lkml/2017/11/25/90). I'm getting the same error on 4.15rc3. I'm working on a fix...

satmandu commented 6 years ago

Does this fix work on 4.15 final?

module/spl/spl-taskq.c: In function ‘taskq_dispatch’:
module/spl/spl-taskq.c:600:16: error: ‘struct timer_list’ has no member named ‘data’
  t->tqent_timer.data = 0;
                ^
module/spl/spl-taskq.c: In function ‘taskq_dispatch_delay’:
module/spl/spl-taskq.c:652:16: error: ‘struct timer_list’ has no member named ‘data’
  t->tqent_timer.data = (unsigned long)t;
                ^
module/spl/spl-taskq.c:654:26: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
  t->tqent_timer.function = task_expire;
                          ^
module/spl/spl-taskq.c: In function ‘taskq_init_ent’:
module/spl/spl-taskq.c:748:2: error: implicit declaration of function ‘init_timer’; did you mean ‘init_timers’? [-Werror=implicit-function-declaration]
  init_timer(&t->tqent_timer);
  ^~~~~~~~~~
  init_timers
cc1: some warnings being treated as errors
tonyhutter commented 6 years ago

@satmandu yes it does.

cracauer commented 6 years ago

This still breaks for me when I use Linux-4.15.5.

This patch looks promising to me, but doesn't merge with spl git as of today and obviously has overlap with SPL's own SPL_AC_KERNEL_TIMER_FUNCTION_TIMER_LIST https://github.com/manjaro/packages-extra/issues/146 https://github.com/manjaro/packages-extra/files/1670385/0001-Linux-4.15-timer-setup-compat.patch.txt

/home/cracauer/work/zfs/spl/module/spl/spl-condvar.c: In function 'spl_io_schedule_timeout': /home/cracauer/work/zfs/spl/module/spl/spl-condvar.c:168:2: error: implicit declaration of function 'init_timer'; did you mean 'init_timers'? [-Werror=implicit-function-declaration] init_timer(&timer); ^~~~~~ init_timers /home/cracauer/work/zfs/spl/module/spl/spl-condvar.c:169:2: error: implicit declaration of function 'setup_timer'; did you mean 'del_timer'? [-Werror=implicit-function-declaration] setup_timer(&timer, __cv_wakeup, (unsigned long)current); ^~~ del_timer

cracauer commented 6 years ago

Oh, duh. Always works. Post about it, find the problem.

I did not do an autogen after git update.

zpl git version works on 4.15.5