HAMMER VFS - Fix incorrect hammer_cursor_removed_node() call in btree_remove()
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 12 Dec 2009 18:50:22 +0000 (10:50 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 12 Dec 2009 18:50:22 +0000 (10:50 -0800)
* hammer_cursor_removed_node() was being called on the wrong node.  This
  fixes a parent != NULL assertion later on.

* There is still at least one known issue where btree_iterate can panic
  due to a cursor tracking issue that has not yet been located.

sys/vfs/hammer/hammer_btree.c

index 6ee1e1a..050d4a2 100644 (file)
@@ -2226,9 +2226,10 @@ btree_remove(hammer_cursor_t cursor)
                        hammer_cursor_deleted_element(cursor->node, 0);
                        error = btree_remove(cursor);
                        if (error == 0) {
+                               KKASSERT(node != cursor->node);
                                hammer_cursor_removed_node(
-                                       node, cursor->parent,
-                                       cursor->parent_index);
+                                       node, cursor->node,
+                                       cursor->index);
                                hammer_modify_node_all(cursor->trans, node);
                                ondisk = node->ondisk;
                                ondisk->type = HAMMER_BTREE_TYPE_DELETED;