bcachefs: Sort & deduplicate updates in bch2_trans_update()
authorKent Overstreet <kent.overstreet@gmail.com>
Wed, 1 Jan 2020 00:37:10 +0000 (19:37 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:33 +0000 (17:08 -0400)
commit24326cd12aa03ea2c6808d09d285af2cecfa4789
treebdd8bc7b527ecb036abbae5c3ba5dae7fb83aed2
parent2d594dfb5357ee133bd4cb04512c2dea65ec3104
bcachefs: Sort & deduplicate updates in bch2_trans_update()

Previously, when doing multiple update in the same transaction commit
that overwrote each other, we relied on doing the updates in the same
order as the bch2_trans_update() calls in order to get the correct
result. But that wasn't correct for triggers; bch2_trans_mark_update()
when marking overwrites would do the wrong thing because it hadn't seen
the update that was being overwritten.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_iter.c
fs/bcachefs/btree_types.h
fs/bcachefs/btree_update.h
fs/bcachefs/btree_update_leaf.c
fs/bcachefs/buckets.c
fs/bcachefs/fs-io.c