From 1ed2ef42e01771f5d8ca9be61e07dcf0fd47feba Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Wed, 6 May 2026 21:21:50 -0700 Subject: p9fs: Move UMA zone initialization to VFS module lifecycle Previously, the UMA zones required for 9P requests (p9fs_buf_zone, p9fs_req_zone, etc.) were initialized and destroyed in the virtio_p9fs transport module. This caused issues when unloading the core p9fs module. This change moves p9_init_zones() and p9_destroy_zones() into p9fs_init() and p9fs_uninit() inside p9fs_vfsops.c so that they are correctly bound to the VFS filesystem module lifecycle via vfs_modevent, aligning p9fs with standard FreeBSD VFS semantics. Found while fixing https://github.com/CTSRD-CHERI/cheribsd/issues/2617. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D56492 --- sys/dev/virtio/p9fs/virtio_p9fs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/virtio/p9fs/virtio_p9fs.c b/sys/dev/virtio/p9fs/virtio_p9fs.c index f76b135c042d..19a32fea458e 100644 --- a/sys/dev/virtio/p9fs/virtio_p9fs.c +++ b/sys/dev/virtio/p9fs/virtio_p9fs.c @@ -471,14 +471,12 @@ vt9p_modevent(module_t mod, int type, void *unused) switch (type) { case MOD_LOAD: if (loaded++ == 0) { - p9_init_zones(); p9_register_trans(&vt9p_trans); } break; case MOD_UNLOAD: if (--loaded == 0) { p9_unregister_trans(&vt9p_trans); - p9_destroy_zones(); } break; case MOD_SHUTDOWN: @@ -487,6 +485,7 @@ vt9p_modevent(module_t mod, int type, void *unused) error = EOPNOTSUPP; break; } + return (error); } -- cgit v1.3