Issue #3467 has been updated by dillon. Status changed from New to Closed
Fixed. commit 0bab2e6c76f675b57015d449f9922353c6d30b86 ---------------------------------------- Bug #3467: kernel: Panic in cache_fullpath() when unmounting / at shutdown http://bugs.dragonflybsd.org/issues/3467#change-14951 * Author: tuxillo * Status: Closed * Priority: Normal * Target version: 6.6 * Start date: 2026-11-10 ---------------------------------------- As of 6.5-DEVELOPMENT (v6.5.0.2152.g732cbb) my desktop panicked on reboot while unmounting /: <pre> Fatal trap 12: page fault while in kernel mode cpuid = 0; lapic id = 0 fault virtual address = 0x88 fault code = supervisor write data, page not present instruction pointer = 0x8:0xffffffff806e413b current process = 1 [...] calltrap() at calltrap+0x9 0xffffffff80bb372a --- trap 000000000000000c, rip = ffffffff806e413b, rsp = fffff80266cfe680, rbp = fffff80266cfe6a8 --- cache_drop() at cache_drop+0x1b 0xffffffff806e413b cache_fullpath() at cache_fullpath+0x6a 0xffffffff806ecb8a </pre> kgdb on the dump shows the rest: mount_warning(), dounmount(), vfs_unmountall(), boot(), sys_reboot(). It comes from 0fe12bb8d3 ("Fix cache_fullpath() races in procfs"). cache_fullpath() now wraps the walk in cache_copy()/cache_drop(). cache_copy() is fine with a NULL ncp but cache_drop() isn't (nc_refs is at 0x88). The root mount's mnt_ncmounton is {NULL, NULL}, so any mount_warning() on / panics now. Before that commit mount_warning() just printed the mp pointer in that case. That commit switched the identical cache_fullpath(NULL, &mp->mnt_ncmounton, ...) call in vfs_getnewfsid() to cache_fullpath_refd(), but missed the one in mount_warning() (vfs_syscalls.c:1141). Still the same on master. Here it was the forced unmount warning, because / still had an extra mount ref after the retries. That ref came from a leaked struct file, which is a separate bug in sys_fchdir(). Fix should be to use cache_fullpath_refd() in mount_warning(), where the mount is locked. Maybe also have cache_fullpath() skip the copy/drop on a NULL ncp so other callers can't hit this. Disks were synced before the panic, so nothing was lost. ---Files-------------------------------- 0001-kernel-use-cache_fullpath_refd-in-mount_warning.patch (1.67 KB) -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account
