HAMMER - Fix lost inode issue (primarily with nohistory mounts)
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 3 Sep 2009 15:18:43 +0000 (08:18 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Thu, 3 Sep 2009 15:18:43 +0000 (08:18 -0700)
commitc9ce54d64fd77d8901f15263a4acbfda66fc1d0b
tree5e01f3ac13ad5f8377d47dadec00902efb864ea8
parentdbcbe5d3b1e3eef64c21a3cf44027d4514b84f11
HAMMER - Fix lost inode issue (primarily with nohistory mounts)

* When a HAMMER cursor is unlocked it becomes tracked and unrelated
  B-Tree operations will cause the tracked cursor's nodes and indices
  to be updated.  The cursor structure also has a leaf element pointer
  which was not being properly updated.  This could lead to panics and
  lost inodes.

  Properly adjust the leaf element pointer in tracked cursors.

* The bug primarily occurs with nohistory mounts or nohistory sub-trees
  due to the larger number of physical deletions made to the B-Tree, but
  could also occur (rarely) with normal mounts.

* Add additional assertions to catch any further occurrences (though I
  think all the cases have been covered now).

* Add a new sysctl vfs.hammer.error_panic which can be set to e.g. 9 to
  cause critical errors to panic immediately instead of returning
  through the call stack, making debugging possible.

Reported-by: Numerous people
sys/vfs/hammer/hammer_btree.c
sys/vfs/hammer/hammer_cursor.c
sys/vfs/hammer/hammer_inode.c
sys/vfs/hammer/hammer_mirror.c
sys/vfs/hammer/hammer_object.c
sys/vfs/hammer/hammer_pfs.c
sys/vfs/hammer/hammer_prune.c
sys/vfs/hammer/hammer_rebalance.c
sys/vfs/hammer/hammer_reblock.c
sys/vfs/hammer/hammer_vfsops.c
sys/vfs/hammer/hammer_vnops.c