Bug 225640 - gbde: panic: mtx_lock() of spin mutex when orphaned
Summary: gbde: panic: mtx_lock() of spin mutex when orphaned
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-geom (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-03 03:31 UTC by Alan Somers
Modified: 2018-02-04 04:26 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Somers freebsd_committer freebsd_triage 2018-02-03 03:31:55 UTC
destroying a gbde device works fine, but orphaning it causes the following panic:

panic: mtx_lock() of spin mutex (null) @ /usr/home/somers/freebsd/base/head/sys/kern/kern_mutex.c:186
cpuid = 3
time = 1517613029
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe000047d850
vpanic() at vpanic+0x18d/frame 0xfffffe000047d8b0
vpanic() at vpanic/frame 0xfffffe000047d930
__mtx_lock_flags() at __mtx_lock_flags+0x163/frame 0xfffffe000047d980
_sleep() at _sleep+0x405/frame 0xfffffe000047da30
g_bde_worker() at g_bde_worker+0x214/frame 0xfffffe000047da70
fork_exit() at fork_exit+0x84/frame 0xfffffe000047dab0
fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe000047dab0
--- trap 0, rip = 0, rsp = 0, rbp = 0 ---

This is on FreeBSD 12.0-CURRENT amd64 at r328767 (1-Feb-2018).

Steps to reproduce:
[somers@fbsd12 ~]$ sudo mdconfig -a -s 1m
md0
[somers@fbsd12 ~]$ sudo gnop create md0
[somers@fbsd12 ~]$ sudo gbde init md0.nop -P xxx
[somers@fbsd12 ~]$ sudo gbde attach md0.nop -p xxx
[somers@fbsd12 ~]$ sudo gnop destroy -f md0.nop