HAMMER VFS - Fix assertion in hammer_btree_mirror_propagate()
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 3 Mar 2010 01:29:14 +0000 (17:29 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 3 Mar 2010 01:29:14 +0000 (17:29 -0800)
* hammer_btree_mirror_propagate() asserts it is on an internal node but
  recovery operations can now place us on a leaf, so just loop if we
  are on a leaf and remove the assertion.

sys/vfs/hammer/hammer_btree.c

index fc093e0..9cc7397 100644 (file)
@@ -2445,8 +2445,14 @@ hammer_btree_mirror_propagate(hammer_cursor_t cursor, hammer_tid_t mirror_tid)
                }
                if (error)
                        break;
+
+               /*
+                * If the cursor deadlocked it could end up at a leaf
+                * after we lost the lock.
+                */
                node = cursor->node;
-               KKASSERT (node->ondisk->type == HAMMER_BTREE_TYPE_INTERNAL);
+               if (node->ondisk->type != HAMMER_BTREE_TYPE_INTERNAL)
+                       continue;
 
                /*
                 * Adjust the node's element