Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zfs-dkms 2.1.13 doesn't build and install module automatically #15328

Closed
EriksRemess opened this issue Sep 28, 2023 · 11 comments · Fixed by #15415
Closed

zfs-dkms 2.1.13 doesn't build and install module automatically #15328

EriksRemess opened this issue Sep 28, 2023 · 11 comments · Fixed by #15415
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)

Comments

@EriksRemess
Copy link

EriksRemess commented Sep 28, 2023

System information

Type Version/Name
Distribution Name Ubuntu
Distribution Version 22.04.3
Kernel Version 6.5.5
Architecture x86_64
OpenZFS Version zfs-2.1.13-1, zfs-kmod-2.1.13-1

Describe the problem you're observing

Built packages according to docs but zfs-dkms doesn't seem to build/install modules automatically anymore.

Describe how to reproduce the problem

Installed zfs-dkms along with other built zfs packages

sudo dpkg -i zfs-dkms_2.1.13-1_amd64.deb .. other debs

Result: everything is installed correctly, old dkms modules gets uninstalled. New modules are not getting automatically built and installed.

Fix/workaround: install manually:

sudo dkms install zfs/2.1.13 -k 6.5.5

Include any warning/errors/backtraces from the system logs

I don't see any warnings/errors in logs.

@EriksRemess EriksRemess added the Type: Defect Incorrect behavior (e.g. crash, hang) label Sep 28, 2023
@peterdk
Copy link

peterdk commented Sep 28, 2023

Same, I already encountered this bug on 2.2.0 RC 3/4. see my comment at #15253

Built debs from source with make deb, and zfs-dkms deb install does not trigger compilation of module. Subsequent reboot reverts to old zfs kernel module from Ubuntu kernel.

zfs-2.1.13-1
zfs-kmod-2.1.9-2ubuntu1.1

Workaround mentioned above does indeed make it compile, and a reboot succeeds with proper kernel modules loaded for zfs.

@EriksRemess
Copy link
Author

EriksRemess commented Sep 28, 2023

on other note:
getting bunch of errors in syslog
UBSAN: array-index-out-of-bounds

example:
[ 6.182752] ================================================================================ [ 6.182762] UBSAN: array-index-out-of-bounds in /var/lib/dkms/zfs/2.1.13/build/module/zfs/zap_leaf.c:394:26 [ 6.182769] index 454 is out of range for type 'uint16_t [1]' [ 6.182774] CPU: 6 PID: 873 Comm: zpool Tainted: P OE 6.5.5-zen3 #1 [ 6.182777] Hardware name: Gigabyte Technology Co., Ltd. B450 I AORUS PRO WIFI/B450 I AORUS PRO WIFI-CF, BIOS F64a 02/09/2023 [ 6.182779] Call Trace: [ 6.182780] <TASK> [ 6.182784] dump_stack_lvl+0x48/0x70 [ 6.182795] dump_stack+0x10/0x20 [ 6.182798] __ubsan_handle_out_of_bounds+0xc5/0x110 [ 6.182804] zap_leaf_lookup+0x1a8/0x1c0 [zfs] [ 6.182906] fzap_lookup+0xe9/0x1d0 [zfs] [ 6.182991] zap_lookup_impl+0xac/0x380 [zfs] [ 6.183073] zap_lookup+0xb9/0x110 [zfs] [ 6.183155] spa_ld_trusted_config+0x77/0x7f0 [zfs] [ 6.183240] ? dsl_pool_init+0x36/0x80 [zfs] [ 6.183302] ? srso_alias_return_thunk+0x5/0x7f [ 6.183307] spa_ld_mos_with_trusted_config.part.0+0x20/0xc0 [zfs] [ 6.183376] spa_load+0x14b/0x1870 [zfs] [ 6.183443] ? srso_alias_return_thunk+0x5/0x7f [ 6.183445] ? srso_alias_return_thunk+0x5/0x7f [ 6.183448] spa_tryimport+0x159/0x430 [zfs] [ 6.183515] zfs_ioc_pool_tryimport+0x85/0xe0 [zfs] [ 6.183583] zfsdev_ioctl_common+0x858/0x9b0 [zfs] [ 6.183647] ? __kmalloc_large_node+0xb9/0x160 [ 6.183653] zfsdev_ioctl+0x57/0xf0 [zfs] [ 6.183715] __x64_sys_ioctl+0xa3/0xf0 [ 6.183718] do_syscall_64+0x5b/0x90 [ 6.183721] ? srso_alias_return_thunk+0x5/0x7f [ 6.183723] ? count_memcg_events.constprop.0+0x2a/0x50 [ 6.183726] ? srso_alias_return_thunk+0x5/0x7f [ 6.183728] ? handle_mm_fault+0xa3/0x360 [ 6.183731] ? srso_alias_return_thunk+0x5/0x7f [ 6.183732] ? exit_to_user_mode_prepare+0x39/0x190 [ 6.183735] ? srso_alias_return_thunk+0x5/0x7f [ 6.183737] ? irqentry_exit_to_user_mode+0x17/0x20 [ 6.183740] ? srso_alias_return_thunk+0x5/0x7f [ 6.183742] ? irqentry_exit+0x43/0x50 [ 6.183744] ? srso_alias_return_thunk+0x5/0x7f [ 6.183746] ? exc_page_fault+0x94/0x1b0 [ 6.183748] entry_SYSCALL_64_after_hwframe+0x6e/0xd8 [ 6.183751] RIP: 0033:0x7f3d94f1aaff [ 6.183754] Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <41> 89 c0 3d 00 f0 ff ff 77 1f 48 8b 44 24 18 64 48 2b 04 25 28 00 [ 6.183755] RSP: 002b:00007ffe06786a10 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [ 6.183758] RAX: ffffffffffffffda RBX: 0000557befcf4570 RCX: 00007f3d94f1aaff [ 6.183759] RDX: 00007ffe06786a80 RSI: 0000000000005a06 RDI: 0000000000000003 [ 6.183760] RBP: 00007ffe0678a060 R08: 00007f3d94cdb010 R09: 00007f3d94cdb010 [ 6.183761] R10: 0000000000000022 R11: 0000000000000246 R12: 00007ffe06786a80 [ 6.183763] R13: 0000557befcf7f30 R14: 0000557befcf7360 R15: 86c56fa03c1d50ce [ 6.183766] </TASK> [ 6.183778] ================================================================================

I guess, related to #15145 (comment)

Update:

Updated patch from previously linked comment in other issue #15145 (comment). As far I can see - it fixes all errors in syslog. No idea why AUTOINSTALL=yes doesn't work.

@blind-oracle
Copy link

Same here, the deb package is missing postinst file which calls /usr/lib/dkms/common.postinst zfs 2.1.13, so you can run it manually and modules would be built.

@amigatomte
Copy link

Same here, the deb package is missing postinst file which calls /usr/lib/dkms/common.postinst zfs 2.1.13, so you can run it manually and modules would be built.

I have the same issue. This workaround works for me. Thanks!

@daniejstriata
Copy link

Same here. Thanks for the workaround.

@JKDingwall
Copy link
Contributor

JKDingwall commented Oct 6, 2023

I am testing a build with c5bbd80 reverted... This has resolved the problem for me, /var/lib/dpkg/info/zfs-dkms.postinst exists and the kernel module is built during the package install. My build environment is based on Ubuntu 20.04.

@peterdk
Copy link

peterdk commented Oct 7, 2023

Tried 2.2.0-rc5, but same issue. However, when triggering postinst manually, there are only 2 modules build and inserted into the kernel. Not sure why. I miss zzstd for example. Weren't there normally like 5 modules? (edit: it does seem to work ok, but not completely sure if this is a intended change in 2.2.0)

sudo /usr/lib/dkms/common.postinst zfs 2.2.0
Loading new zfs-2.2.0 DKMS files...
Building for 6.5.0-1004-oem
Building initial module for 6.5.0-1004-oem
Secure Boot not enabled on this system.
Done.

zfs.ko.zst:
Running module version sanity check.
 - Original module
 - Installation
   - Installing to /lib/modules/6.5.0-1004-oem/updates/dkms/

spl.ko.zst:
Running module version sanity check.
 - Original module
 - Installation
   - Installing to /lib/modules/6.5.0-1004-oem/updates/dkms/

depmod...

@aluo-x
Copy link

aluo-x commented Oct 12, 2023

Also encountering this issue. Tagging @behlendorf

@jeremyvisser
Copy link
Contributor

I am testing a build with c5bbd80 reverted... This has resolved the problem for me, /var/lib/dpkg/info/zfs-dkms.postinst exists and the kernel module is built during the package install. My build environment is based on Ubuntu 20.04.

No, that's incorrect. The actual root cause is this:

@AllKind
Copy link
Contributor

AllKind commented Oct 17, 2023

Experiencing the same issue on Linux Mint 21.2 with custom kernel 5.15.135 and dkms version 2.8.7.

@AllKind
Copy link
Contributor

AllKind commented Oct 18, 2023

I tried to work that out and came up with this: #15415
If someone would be willing to test it, that would be nice! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants