tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: WAPBL not locking enough?



   Date: Wed, 11 May 2016 11:30:39 +0000
   From: coypu%SDF.ORG@localhost

   @@ -1624,6 +1627,9 @@ wapbl_flush(struct wapbl *wl, int waitfor)
           }

           error = wapbl_truncate(wl, flushsize);
   +
   +       mutex_exit(&wl->wl_mtx);
   +

Can't hold wl->wl_mtx across wapbl_truncate -- wapbl_truncate waits
for I/O (not allowed while holding a mutex) and also acquires
wl->wl_mtx itself internally.

Before sprinkling in changes to locking, let's figure out what
invariants the locks actually provide, and sprinkle in KASSERTs as
appropriate to check where the invariants are guaranteed to hold.

For the case of wapbl_transaction_len, as noted in private mail
(probably sent after you wrote this message) the situation is a little
tricky and needs more care than just adding mutex_enter/exit in a
couple places.


Home | Main Index | Thread Index | Old Index