Update bcachefs sources to bd6ed9fb42 fixup! bcachefs: Fix initialization of bch_write_op.nonce

This commit is contained in:
Kent Overstreet 2021-09-21 20:49:08 -04:00
parent 2b8c1bb091
commit 08802949e2
4 changed files with 11 additions and 3 deletions

View File

@ -1 +1 @@
3f3f9698592290e98a727f5023115c1775be7d5f
bd6ed9fb42c0aa36d1f4a21eeab45fe12e1fb792

View File

@ -770,7 +770,12 @@ struct btree *bch2_btree_node_get(struct btree_trans *trans, struct btree_path *
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:

View File

@ -795,6 +795,9 @@ bch2_trans_commit_get_rw_cold(struct btree_trans *trans)
if (ret)
return ret;
if (!bch2_trans_relock(trans))
return -EINTR;
percpu_ref_get(&c->writes);
return 0;
}

View File

@ -263,7 +263,7 @@ int bch2_migrate_write_init(struct bch_fs *c, struct migrate_write *m,
*/
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;
}