11002 recursive mutex detection in libfakekernel

Review Request #1965 — Created June 4, 2019 and submitted


11002 recursive mutex detection in libfakekernel

Debugging in fksmbd, noticed a recursive mutex hang. That should panic. Verified it does after the fix.

  2. FWIW, you may want to investigate changing this all to using the actual kernel analogue that exists in userland, being mutex_enter() and mutex_exit(). I'm not sure if using the lwp locks are paritcularly special in this case.

    You probably also want to actually check the unlock path in kmutex_exit() now.

    1. Yeah, that's a good idea, but I think for now I'd rather file an issue for switching to mutex_enter/mutex_exit and do that separately. I'll look at kmutex_exit.

    2. I opened a bug for your suggestion: 11189
      Let libfakekernel use mutex_enter/mutex_exit

      I looked at kmutex_exit, and yes, I could add a check to kmutex_exit, but as that code will go away with 11189 let's just leave that too (for now). I don't think there's anything really important that kmutex_enter won't also check in the current implementation.

Review request changed

Status: Closed (submitted)