openzfs / spl

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

spl-0.7.12 fails to build with 4.19 PREEMPT RT kernel on Debian #718

Closed happyaron closed 4 years ago

happyaron commented 5 years ago

spl-dkms/0.7.12-2~bpo9+1 fails to build with the PREEMPT RT version of linux 4.19.37-4~bpo9+1, package names are linux-{image,headers}-4.19.0-0.bpo.5-rt-amd64. Both of these versions are provided through stretch-backports.

[...]
  CC [M]  /var/lib/dkms/spl/0.7.12/build/module/splat/splat-rwlock.o
In file included from /var/lib/dkms/spl/0.7.12/build/include/sys/rwlock.h:30:0,
                 from /var/lib/dkms/spl/0.7.12/build/module/splat/splat-rwlock.c:28:
/var/lib/dkms/spl/0.7.12/build/module/splat/splat-rwlock.c: In function ‘splat_rwlock_test6’:
/var/lib/dkms/spl/0.7.12/build/include/linux/rwsem_compat.h:43:29: error: ‘struct rw_semaphore’ has no member named ‘read_depth’; did you mean ‘readers’?
 #define RWSEM_COUNT(sem) sem->read_depth
                             ^
/var/lib/dkms/spl/0.7.12/build/module/splat/splat-rwlock.c:611:6: note: in expansion of macro ‘RWSEM_COUNT’
  if (RWSEM_COUNT(SEM(&rwp->rw_rwlock)) !=
      ^~~~~~~~~~~
In file included from /var/lib/dkms/spl/0.7.12/build/module/splat/splat-rwlock.c:32:0:
/var/lib/dkms/spl/0.7.12/build/include/linux/rwsem_compat.h:43:29: error: ‘struct rw_semaphore’ has no member named ‘read_depth’; did you mean ‘readers’?
 #define RWSEM_COUNT(sem) sem->read_depth
                             ^
/var/lib/dkms/spl/0.7.12/build/module/splat/splat-internal.h:78:45: note: in definition of macro ‘splat_print’
   _rc_ = sprintf(_info_->info_head, format, args); \
                                             ^~~~
/var/lib/dkms/spl/0.7.12/build/module/splat/splat-rwlock.c:613:3: note: in expansion of macro ‘splat_vprint’
   splat_vprint(file, SPLAT_RWLOCK_TEST6_NAME,
   ^~~~~~~~~~~~
/var/lib/dkms/spl/0.7.12/build/module/splat/splat-rwlock.c:617:17: note: in expansion of macro ‘RWSEM_COUNT’
       (long int)RWSEM_COUNT(SEM(&rwp->rw_rwlock)));
                 ^~~~~~~~~~~
In file included from /var/lib/dkms/spl/0.7.12/build/include/sys/rwlock.h:30:0,
                 from /var/lib/dkms/spl/0.7.12/build/module/splat/splat-rwlock.c:28:
/var/lib/dkms/spl/0.7.12/build/include/linux/rwsem_compat.h:43:29: error: ‘struct rw_semaphore’ has no member named ‘read_depth’; did you mean ‘readers’?
 #define RWSEM_COUNT(sem) sem->read_depth
                             ^
/var/lib/dkms/spl/0.7.12/build/module/splat/splat-rwlock.c:624:6: note: in expansion of macro ‘RWSEM_COUNT’
  if (RWSEM_COUNT(SEM(&rwp->rw_rwlock)) !=
      ^~~~~~~~~~~
In file included from /var/lib/dkms/spl/0.7.12/build/module/splat/splat-rwlock.c:32:0:
/var/lib/dkms/spl/0.7.12/build/include/linux/rwsem_compat.h:43:29: error: ‘struct rw_semaphore’ has no member named ‘read_depth’; did you mean ‘readers’?
 #define RWSEM_COUNT(sem) sem->read_depth
                             ^
/var/lib/dkms/spl/0.7.12/build/module/splat/splat-internal.h:78:45: note: in definition of macro ‘splat_print’
   _rc_ = sprintf(_info_->info_head, format, args); \
                                             ^~~~
/var/lib/dkms/spl/0.7.12/build/module/splat/splat-rwlock.c:626:3: note: in expansion of macro ‘splat_vprint’
   splat_vprint(file, SPLAT_RWLOCK_TEST6_NAME,
   ^~~~~~~~~~~~
/var/lib/dkms/spl/0.7.12/build/module/splat/splat-rwlock.c:630:17: note: in expansion of macro ‘RWSEM_COUNT’
       (long int)RWSEM_COUNT(SEM(&rwp->rw_rwlock)));
                 ^~~~~~~~~~~
/usr/src/linux-headers-4.19.0-0.bpo.5-common-rt/scripts/Makefile.build:308: recipe for target '/var/lib/dkms/spl/0.7.12/build/module/splat/splat-rwlock.o' failed
make[7]: *** [/var/lib/dkms/spl/0.7.12/build/module/splat/splat-rwlock.o] Error 1
/usr/src/linux-headers-4.19.0-0.bpo.5-common-rt/scripts/Makefile.build:549: recipe for target '/var/lib/dkms/spl/0.7.12/build/module/splat' failed
make[6]: *** [/var/lib/dkms/spl/0.7.12/build/module/splat] Error 2
[...]
Berghopper commented 4 years ago

+1

Same problem, tried solving by reverting to my old kernel (4.9) via GRUB_DEFAULT, now my server doesnt boot :/... (dont have a screen or keyboard at hand right now)

The latter is my own problem, but this bug is really annoying and seems to be reoccuring (#709 ).

I however had a slightly different error, for me instead, I got complaints about the buildfile not existing (configure exited with an error). But exact same bpo kernel. I will update on the errors later, once I have time to work on it.

Not only that, but this is definetely not the first time people have reported zfs not working on their some kernels;

https://serverfault.com/questions/943476/zfs-not-installed-into-upgraded-kernel-4-19

https://github.com/zfsonlinux/zfs/issues/8388

Sorry for the rant, is there any reason as to why these kernel issues are persistent like this?

baryluk commented 4 years ago

On Linux 5.2.0-3 with PREEMPT RT patches, as distributed in Debian testing.

/var/lib/dkms/spl/0.7.12/build/include/linux/rwsem_compat.h:43:31: error: ‘struct rw_semaphore’ has no member named ‘read_depth’; did you mean ‘readers’?
#define RWSEM_COUNT(sem) sem->read_depth

However, when I just tested with zfs-dkms 0.8.2-2 from Debian testing, and Linux 5.2.0-3-rt from Debian testing, it did build successfully: dkms claims all good, and I see icp.ko spl.ko zavl.ko zcommon.ko zfs.ko zlua.ko znvpair.ko zunicode.ko in a proper directory (/usr/lib/modules/5.2.0-3-rt-amd64/updates/dkms).

# dkms status -k 5.2.0-3-rt-amd64 zfs
zfs, 0.8.2, 5.2.0-3-rt-amd64, x86_64: installed
# 

@Berghopper This is pretty normal for any complex kernel module that lives outside of the main tree. You should make sure that zfs modules compiled on kernel upgrades. Also, you should be able to boot a previous kernel without issue. The fact that you don't have a backup plan is not zfs or zfs module fault.

@Berghopper Are you sure it is the same kernel. This issue is specifically about -rt kernel. Why would you use it on the server?

baryluk commented 4 years ago

Nevermind anyway. This is spl bug tracker. I should have looked at the zfs repo and issue tracker.

I do not think anybody want to be backporting any new features or fixes to spl repo.

Can be closed.

Berghopper commented 4 years ago

@baryluk

Yes I realized later it was the spl tracker too, and no I don't have the exact same kernel. I updated my own issue on; https://github.com/zfsonlinux/zfs/issues/9496

For some reason my old kernel (4.9.0.6) got fudged and didn't want to mount /boot/efi, I was lucky enough to have another kernel (4.9.0.3) to boot to, otherwise I needed a reinstall.

Anyway, I eventually reverted and all is well now.

Edit; as to why I upgraded my kernel in the first place; I have a Ryzen cpu and wanted to possibly have better support for my specific chipset, however the old kernel was functioning fine, just couldn't read cpu temps etc. Also, I'm pretty noobish when it comes to linux, I do linux administration as a hobby and some things are a bit hard to grasp.

behlendorf commented 4 years ago

Closing. The SPL has been incorporated in to the ZFS repository.