From: Matthew Dillon Date: Mon, 15 Mar 2010 17:49:03 +0000 (-0700) Subject: HAMMER VFS - Hack cursor iterator when locked cursor moved to parent X-Git-Tag: v2.7.0~83 X-Git-Url: https://repo.or.cz/w/dragonfly.git/commitdiff_plain/ec9b6294f7ea2d9365124dd1e50ebe21c78da8b2 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 --- 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);