HAMMER - Fix cursor tracking bugs and a few other issues
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 31 Oct 2009 01:29:04 +0000 (18:29 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 31 Oct 2009 01:29:04 +0000 (18:29 -0700)
commitf3a4893b0e844e1ab8c2334d304ebff61aa71ace
tree8c40d712e07a5f56571bc8a9ca516e96568bb5fc
parente20d310334e12a1d7f96c13ad7e140baea82c9e2
HAMMER - Fix cursor tracking bugs and a few other issues

* When recursively removing empty internal nodes from the B-Tree only
  call hammer_cursor_deleted_element() if the related internal
  element is actually removed.  The element might not be removed due
  to the deadlock fail path.

* If hammer_cursor_up_locked() fails fully restore the cursor before
  returning.  The index field was not being restored.

* Acquire the sync lock when recovering a cursor lost due to a deadlock
  in the mirroring code.

* Document and fix an issue in the rebalancing code which could cause a
  cursor to fall off the end of the B-Tree.

Reported-by: YONETANI Tomokazu <qhwt+dfly@les.ath.cx>
sys/vfs/hammer/hammer_btree.c
sys/vfs/hammer/hammer_cursor.c
sys/vfs/hammer/hammer_mirror.c
sys/vfs/hammer/hammer_rebalance.c