On Mon, 7 Jun 2010, Pawel Jakub Dawidek wrote:

  1) Further enhance the INVARIANT lock validation (no locks) are
     held by checking the create and inp locks as well.
[...]
+       if (mtx_owned(&inp->inp_create_mtx)) {
+               panic("Own create lock on inp");
+       }
+       if (mtx_owned(&inp->inp_mtx)) {
+               panic("Own inp lock on inp");
+       }

If you replace this with:

        mtx_assert(&inp->inp_create_mtx, MA_NOTOWNED);
        mtx_assert(&inp->inp_mtx, MA_NOTOWNED);

But the kernel has to be compiled with INVARIANTS to make it work.

It might be worth mimicking the locking assertions from in_pcb.h, even though these data structures are different.

Robert
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to