-3f3f9698592290e98a727f5023115c1775be7d5f
+bd6ed9fb42c0aa36d1f4a21eeab45fe12e1fb792
if (c->opts.btree_node_mem_ptr_optimization) {
b = btree_node_mem_ptr(k);
- if (b)
+ /*
+ * Check b->hash_val _before_ calling btree_node_lock() - this
+ * might not be the node we want anymore, and trying to lock the
+ * wrong node could cause an unneccessary transaction restart:
+ */
+ if (b && b->hash_val == btree_ptr_hash_val(k))
goto lock_node;
}
retry:
if (ret)
return ret;
+ if (!bch2_trans_relock(trans))
+ return -EINTR;
+
percpu_ref_get(&c->writes);
return 0;
}
*/
bkey_for_each_crc(k.k, ptrs, crc, entry)
if (bch2_csum_type_is_encryption(crc.csum_type)) {
- m->op.nonce = crc.nonce + m->op.crc.offset;
+ m->op.nonce = crc.nonce + crc.offset;
m->op.csum_type = crc.csum_type;
break;
}