From ec9b6294f7ea2d9365124dd1e50ebe21c78da8b2 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Mon, 15 Mar 2010 10:49:03 -0700 Subject: [PATCH] HAMMER VFS - Hack cursor iterator when locked cursor moved to parent * A cursor is also moved to its parent normally when deleting the last element in a node and that node is then destroyed. Reported-by: YONETANI Tomokazu --- sys/vfs/hammer/hammer_btree.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/vfs/hammer/hammer_btree.c b/sys/vfs/hammer/hammer_btree.c index 8a6ce34e60..91cb117426 100644 --- a/sys/vfs/hammer/hammer_btree.c +++ b/sys/vfs/hammer/hammer_btree.c @@ -2418,8 +2418,11 @@ btree_remove(hammer_cursor_t cursor) /* * cursor->node is invalid, cursor up to make the cursor - * valid again. + * valid again. We have to flag the condition in case + * another thread wiggles an insertion in during an + * iteration. */ + cursor->flags |= HAMMER_CURSOR_ITERATE_CHECK; error = hammer_cursor_up(cursor); } return (error); -- 2.41.0