]> git.sesse.net Git - bcachefs-tools-debian/commitdiff
Update bcachefs sources to bd6ed9fb42 fixup! bcachefs: Fix initialization of bch_writ...
authorKent Overstreet <kent.overstreet@gmail.com>
Wed, 22 Sep 2021 00:49:08 +0000 (20:49 -0400)
committerKent Overstreet <kent.overstreet@gmail.com>
Wed, 22 Sep 2021 00:49:08 +0000 (20:49 -0400)
.bcachefs_revision
libbcachefs/btree_cache.c
libbcachefs/btree_update_leaf.c
libbcachefs/move.c

index e80bf480fd9b0e264f2d5109f4dda4b81c711e4b..d53addfb80e73e22d40dbb7055d92044ce75c4be 100644 (file)
@@ -1 +1 @@
-3f3f9698592290e98a727f5023115c1775be7d5f
+bd6ed9fb42c0aa36d1f4a21eeab45fe12e1fb792
index 5f9ab818e2a7f4c25e27d9c17974e679a21af777..905237a7ba05a3082d39e5da4db34c6b5ae56a3c 100644 (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:
index 9c8c5cacc4fced52c1b6f7074a599f30a4b24309..a0da96737700b85f5bb82dcdba8b66c267649f78 100644 (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;
 }
index fb7c0abd40b19370f31c3ee24a1fb5703c5cc254..7001e3cda8c5ec06d3f141395430ccff46f20f84 100644 (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;
                }