⬢ DragonFlyBSD Kernel Audit
DF-3110 / fix.diff
← back to finding ↓ download raw
--- a/sys/vfs/hammer/hammer_cursor.c
+++ b/sys/vfs/hammer/hammer_cursor.c
@@ -1052,9 +1052,9 @@ hammer_cursor_moved_element(hammer_node_t onode, hammer_node_t nnode,
 		KKASSERT(cursor->node == oparent);
 		if (cursor->index != pindex)
 			continue;
 		hkprintf("debug: shifted cursor pointing at parent\n"
 			"parent %016jx:%d onode %016jx:%d nnode %016jx:%d\n",
@@ -1064,9 +1064,9 @@ hammer_cursor_moved_element(hammer_node_t onode, hammer_node_t nnode,
 			(intmax_t)nnode->node_offset, nindex);
 		TAILQ_REMOVE(&oparent->cursor_list, cursor, deadlk_entry);
 		TAILQ_INSERT_TAIL(&nnode->cursor_list, cursor, deadlk_entry);
-		if (cursor->leaf == &ondisk->elms[oindex].leaf)
+		if (cursor->leaf == &ondisk->elms[pindex].leaf)
 			cursor->leaf = &nndisk->elms[nindex].leaf;
 		cursor->node = nnode;