kernel - Fix bug in lwkt_token_swap()
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 7 Oct 2011 07:22:09 +0000 (00:22 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 7 Oct 2011 07:22:09 +0000 (00:22 -0700)
commit315422416abed4ef71e97ac2d2a35d23e4a4827a
treea5719c7bfeda71d6d822fd5e1d27775babdb6faf
parentb1af942c63df77b14b166d487f28e5a5463d8817
kernel - Fix bug in lwkt_token_swap()

* Fix a bug where lwkt_token_swap() would incorrectly assign the ref
  pointer when the top two tokens on the stack are the same token.

  When swapping the top two tokens where tok1 == tok2, the token
  can wind up being repointed to the top ref instead of the deeper
  ref.  When the top ref is released this caused the token to also
  release even though there was another deeper ref to the same
  token.

* Effected the vm_object traversal code and could cause an object token
  to be effectively lost without triggering a panic, resulting in
  corruption.
sys/kern/lwkt_token.c