diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2020-12-10 13:13:56 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:49 -0400 |
commit | 719fe7fb555ad9a53bb847bfae1cad7170cb2591 (patch) | |
tree | 4cff16bae6182d328467ab7d24d28fa413e7be53 /fs/bcachefs/recovery.c | |
parent | 66bddc6c2b389a65708c27e7e7a9969e645ca799 (diff) | |
download | lwn-719fe7fb555ad9a53bb847bfae1cad7170cb2591.tar.gz lwn-719fe7fb555ad9a53bb847bfae1cad7170cb2591.zip |
bcachefs: Update transactional triggers interface to pass old & new keys
This is needed to fix a bug where we're overflowing iterators within a
btree transaction, because we're updating the stripes btree (to update
block counts) and the stripes btree trigger is unnecessarily updating
the alloc btree - it doesn't need to update the alloc btree when the
pointers within a stripe aren't changing.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/recovery.c')
-rw-r--r-- | fs/bcachefs/recovery.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c index ecd51d45743a..1883a1faf380 100644 --- a/fs/bcachefs/recovery.c +++ b/fs/bcachefs/recovery.c @@ -458,7 +458,9 @@ retry: bch2_btree_iter_set_pos(iter, split->k.p); if (remark) { - ret = bch2_trans_mark_key(&trans, bkey_i_to_s_c(split), + ret = bch2_trans_mark_key(&trans, + bkey_s_c_null, + bkey_i_to_s_c(split), 0, split->k.size, BTREE_TRIGGER_INSERT); if (ret) @@ -467,7 +469,9 @@ retry: } while (bkey_cmp(iter->pos, k->k.p) < 0); if (remark) { - ret = bch2_trans_mark_key(&trans, bkey_i_to_s_c(k), + ret = bch2_trans_mark_key(&trans, + bkey_i_to_s_c(k), + bkey_s_c_null, 0, -((s64) k->k.size), BTREE_TRIGGER_OVERWRITE); if (ret) |