Exporting a logical volume via NBD leads to kernel crashes
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux-signed-hwe-5.19 (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
I'm exporting a logical volume via nbd-server to a raspberry pi which uses the nbd device as a physical volume for its own LVM stack. Some operations such as running mkfs.ext2 on a logical volume inside the raspberry pi crash the exporting server. I have seen various messages from the kernel in the syslog & dmesg and experienced lock-ups etc. The operations that cause this cause the issues consistently. For instance the mkfs.ext2 on the RPI cause this to appear in dmesg on the server exporting the NBD:
[ 1188.468279] ------------[ cut here ]------------
[ 1188.468282] kernel BUG at include/
[ 1188.468289] invalid opcode: 0000 [#1] PREEMPT SMP NOPTI
[ 1188.468292] CPU: 2 PID: 4944 Comm: pool Not tainted 5.19.0-32-generic #33~22.04.1-Ubuntu
[ 1188.468295] Hardware name: Gigabyte Technology Co., Ltd. X570 GAMING X/X570 GAMING X, BIOS F37 12/26/2022
[ 1188.468296] RIP: 0010:zero_
[ 1188.468303] Code: ff 48 8b 57 48 f6 c2 01 0f 84 00 ff ff ff 48 83 ea 01 48 39 d7 0f 84 f3 fe ff ff 41 be 00 10 00 00 4c 39 f0 0f 86 03 ff ff ff <0f> 0b f7 c3 ff 0f 00 00 0f 85 04 ff ff ff 48 8b 03 a9 00 00 01 00
[ 1188.468305] RSP: 0018:ffffbe5984
[ 1188.468308] RAX: 00000000fae00000 RBX: fffff46887f2f800 RCX: 0000000000000000
[ 1188.468309] RDX: 0017ffffc0020037 RSI: 0000000000000000 RDI: fffff46887f2f800
[ 1188.468311] RBP: ffffbe5984817c20 R08: fffff46880000000 R09: 0000000000000000
[ 1188.468312] R10: 0000000000000000 R11: 0000000000000000 R12: 00000000fae00000
[ 1188.468314] R13: 0000000000000000 R14: 0000000000001000 R15: ffff977ac0000000
[ 1188.468315] FS: 00007fd36bfff64
[ 1188.468317] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1188.468319] CR2: 000004c500e89000 CR3: 0000000114472000 CR4: 0000000000350ee0
[ 1188.468321] Call Trace:
[ 1188.468323] <TASK>
[ 1188.468325] truncate_
[ 1188.468329] truncate_
[ 1188.468332] ? hrtimer_
[ 1188.468335] ? futex_wait+
[ 1188.468339] ? __hrtimer_
[ 1188.468342] ? rseq_get_
[ 1188.468345] ? bd_prepare_
[ 1188.468349] ? rseq_ip_
[ 1188.468351] truncate_
[ 1188.468354] blkdev_
[ 1188.468358] blkdev_
[ 1188.468360] __x64_sys_
[ 1188.468363] do_syscall_
[ 1188.468367] ? syscall_
[ 1188.468370] ? do_syscall_
[ 1188.468372] ? do_syscall_
[ 1188.468375] ? syscall_
[ 1188.468377] entry_SYSCALL_
[ 1188.468380] RIP: 0033:0x7fd371d1aaff
[ 1188.468383] 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
[ 1188.468385] RSP: 002b:00007fd36b
[ 1188.468387] RAX: ffffffffffffffda RBX: 00007fd36bffebb0 RCX: 00007fd371d1aaff
[ 1188.468389] RDX: 00007fd36bffebb0 RSI: 0000000000001277 RDI: 0000000000000007
[ 1188.468390] RBP: 00007fd36bffec00 R08: 0000000000000000 R09: 0000000000000001
[ 1188.468391] R10: fffffffbfae00000 R11: 0000000000000246 R12: 0000557743114ea0
[ 1188.468393] R13: 0000557743114e40 R14: 00005577431117d0 R15: 0000000000000007
[ 1188.468395] </TASK>
[ 1188.468396] Modules linked in: rfcomm snd_hda_
[ 1188.468452] aesni_intel crypto_simd fb_sys_fops nvme ahci xhci_pci r8169 cryptd psmouse drm i2c_piix4 nvme_core libahci xhci_pci_renesas realtek wmi
[ 1188.468463] ---[ end trace 0000000000000000 ]---
[ 1188.614812] RIP: 0010:zero_
[ 1188.614818] Code: ff 48 8b 57 48 f6 c2 01 0f 84 00 ff ff ff 48 83 ea 01 48 39 d7 0f 84 f3 fe ff ff 41 be 00 10 00 00 4c 39 f0 0f 86 03 ff ff ff <0f> 0b f7 c3 ff 0f 00 00 0f 85 04 ff ff ff 48 8b 03 a9 00 00 01 00
[ 1188.614820] RSP: 0018:ffffbe5984
[ 1188.614823] RAX: 00000000fae00000 RBX: fffff46887f2f800 RCX: 0000000000000000
[ 1188.614825] RDX: 0017ffffc0020037 RSI: 0000000000000000 RDI: fffff46887f2f800
[ 1188.614827] RBP: ffffbe5984817c20 R08: fffff46880000000 R09: 0000000000000000
[ 1188.614829] R10: 0000000000000000 R11: 0000000000000000 R12: 00000000fae00000
[ 1188.614831] R13: 0000000000000000 R14: 0000000000001000 R15: ffff977ac0000000
[ 1188.614833] FS: 00007fd36bfff64
[ 1188.614835] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1188.614838] CR2: 000004c500e89000 CR3: 0000000114472000 CR4: 0000000000350ee0
The server-side setup uses the package nbd-server, a udev-rule to make certain server-side LVs accessible to ndb-server and a single export config file:
sudo apt install nbd-server
sudo install -m 0644 /dev/fd/0 /etc/udev/
sudo install -m 0644 -D /dev/fd/0 /etc/nbd-
[ws4051]
splice=true
exportname=
trim=true
flush=true
fua=true
EOF
sudo lvcreate -n nbd-ws4051 -L 32G vg0
The client (raspberry pi) uses packages linux-modules-
net.ifnames=0 ip=:::::eth0:dhcp nbdroot=
The block device so imported is a LVM PV which contains the PIs root FS etc as well as a LV boot. It is this LV that I am running mkfs.ext2 on.
ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: linux-image-
ProcVersionSign
Uname: Linux 5.19.0-32-generic x86_64
ApportVersion: 2.20.11-0ubuntu82.3
Architecture: amd64
CasperMD5CheckR
CurrentDesktop: ubuntu:GNOME
Date: Mon Feb 20 10:18:47 2023
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_NZ.UTF-8
SHELL=/bin/bash
SourcePackage: linux-signed-
UpgradeStatus: No upgrade log present (probably fresh install)