From 95885f2087bf8a2ded4c9db3a3ab808140d49bae Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Tue, 2 Mar 2010 17:29:14 -0800 Subject: [PATCH] HAMMER VFS - Fix assertion in hammer_btree_mirror_propagate() * 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 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/vfs/hammer/hammer_btree.c b/sys/vfs/hammer/hammer_btree.c index fc093e0d7d..9cc7397a63 100644 --- a/sys/vfs/hammer/hammer_btree.c +++ b/sys/vfs/hammer/hammer_btree.c @@ -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 -- 2.41.0