diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-27 15:23:46 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-11-01 21:11:08 -0400 |
commit | be9e782df3cb557715630a61dc79d9f966737859 (patch) | |
tree | 68c77fe233bb9de8c3b3d9140e64e0ea152dfead /fs/bcachefs/data_update.c | |
parent | bcachefs: Fix deleted inodes btree in snapshot deletion (diff) | |
download | linux-be9e782df3cb557715630a61dc79d9f966737859.tar.gz linux-be9e782df3cb557715630a61dc79d9f966737859.tar.bz2 linux-be9e782df3cb557715630a61dc79d9f966737859.zip |
bcachefs: Don't downgrade locks on transaction restart
We should only be downgrading locks on success - otherwise, our
transaction restarts won't be getting the correct locks and we'll
livelock.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/data_update.c')
-rw-r--r-- | fs/bcachefs/data_update.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/fs/bcachefs/data_update.c b/fs/bcachefs/data_update.c index d116f2f03db2..0771a6d880bf 100644 --- a/fs/bcachefs/data_update.c +++ b/fs/bcachefs/data_update.c @@ -162,11 +162,7 @@ static int __bch2_data_update_index_update(struct btree_trans *trans, if (((1U << i) & m->data_opts.rewrite_ptrs) && (ptr = bch2_extent_has_ptr(old, p, bkey_i_to_s(insert))) && !ptr->cached) { - bch2_bkey_drop_ptr_noerror(bkey_i_to_s(insert), ptr); - /* - * See comment below: bch2_extent_ptr_set_cached(bkey_i_to_s(insert), ptr); - */ rewrites_found |= 1U << i; } i++; @@ -212,14 +208,8 @@ restart_drop_extra_replicas: if (!p.ptr.cached && durability - ptr_durability >= m->op.opts.data_replicas) { durability -= ptr_durability; - bch2_bkey_drop_ptr_noerror(bkey_i_to_s(insert), &entry->ptr); - /* - * Currently, we're dropping unneeded replicas - * instead of marking them as cached, since - * cached data in stripe buckets prevents them - * from being reused: + bch2_extent_ptr_set_cached(bkey_i_to_s(insert), &entry->ptr); - */ goto restart_drop_extra_replicas; } } |