- /* Another concurrent thread stole it ? If so, let it deal with this. */
- if (cmpxchg(&node->stolen, 0, 1) != 0)
- goto error;
+ if (!del_node) {
+ /*
+ * Another concurrent thread stole it ? If so, let it deal with
+ * this. Assume NODE_STOLEN is the only flag. If this changes,
+ * read flags before cmpxchg.
+ */
+ if (cmpxchg(&node->flags, 0, NODE_STOLEN) != 0)
+ goto error;
+ }