Module Name: src Committed By: jdolecek Date: Sun Apr 12 08:51:41 UTC 2020
Modified Files: src/sys/kern: vfs_wapbl.c Log Message: fix race between wapbl_discard() and wapbl_biodone() on forced unmount on shutdown with slow I/O device wapbl_discard() needs to hold both wl_mtx and bufcache_lock while manipulating wl_entries - the rw lock is not enough, because wapbl_biodone() only takes wl_mtx while removing the finished entry from list wapbl_biodone() must take bufcache_lock before reading we->we_wapbl, so it's blocked until wapbl_discard() finishes, and takes !wl path appropriately this is supposed to fix panic on shutdown: [ 67549.6304123] forcefully unmounting / (/dev/wd0a)... ... [ 67549.7272030] panic: mutex_vector_enter,510: uninitialized lock (lock=0xffffa722a4f4f5b0, from=ffffffff80a884fa) ... [ 67549.7272030] wapbl_biodone() at netbsd:wapbl_biodone+0x4d [ 67549.7272030] biointr() at netbsd:biointr+0x7d [ 67549.7272030] softint_dispatch() at netbsd:softint_dispatch+0x12c [ 67549.7272030] Xsoftintr() at netbsd:Xsoftintr+0x4f To generate a diff of this commit: cvs rdiff -u -r1.106 -r1.107 src/sys/kern/vfs_wapbl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.