Summary: | 9pfs kernel page fault on shutdown on a bhyveload(8) or UEFI-booted FreeBSD VM | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Michael Dexter <editor> | ||||
Component: | bin | Assignee: | freebsd-virtualization (Nobody) <virtualization> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Only Me | CC: | danilo, dch, dfr, lwhsu, osidorkin, ziaee | ||||
Priority: | --- | ||||||
Version: | 15.0-CURRENT | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
Description
Michael Dexter
2024-06-21 05:59:00 UTC
Created attachment 251902 [details]
p9fs_vnops
Apparently there is some code duplication in p9fs_cleanup()? Maybe due to a bad merge or something? The attached patch fixed the panic for me. According to, what I believe is, the original implementation, that code is really duplicated: https://github.com/Juniper/virtfs/blob/jnpr/virtfs/sys/dev/virtio/9pfs/virtfs_vnops.c#L97 I'll create a PR on Github today if nobody pushes a fix first. Michael, did you have the chance to test the fix? (In reply to Danilo Egea Gondolfo from comment #3) File to patch: /usr/src/sys/fs/p9fs/p9fs_vnops.c Patching file /usr/src/sys/fs/p9fs/p9fs_vnops.c using Plan A... Hunk #1 succeeded at 125. done (buildkernel/installkernel) (boot) root@freebsd:~ # uname -a FreeBSD freebsd 15.0-CURRENT FreeBSD 15.0-CURRENT #0: Sat Jul 13 01:43:28 UTC 2024 root @t14:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64 root@freebsd:~ # reboot Jul 13 01:46:23 freebsd syslogd: exiting on signal 15 Waiting (max 60 seconds) for system process `vnlru' to stop... done Waiting (max 60 seconds) for system process `syncer' to stop... Syncing disks, vnodes remaining... 0 0 done All buffers synced. Uptime: 54s root@t14:~/imagine-work # sh: turning off NDELAY mode Yes! No page fault on shutdown! Hopefully that's it. Good work! A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=a6ca6dfd60b66eec563bd473d96b31f0be1de80a commit a6ca6dfd60b66eec563bd473d96b31f0be1de80a Author: Danilo Egea Gondolfo <danilo@FreeBSD.org> AuthorDate: 2024-07-09 19:07:18 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2024-07-13 03:40:09 +0000 p9fs: remove duplicated code This code is using the vnode after it has been released and causing a panic when a p9fs shared volume is unmounted. In fact, it seems like it's just duplicated code left behind from a bad merge. PR: 279887 Reported by: Michael Dexter Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1323 sys/fs/p9fs/p9fs_vnops.c | 10 ---------- 1 file changed, 10 deletions(-) The proposed patch appears to work and has been committed. Thank you Danilo and Warner! Closing as FIXED until further notice. |