bcachefs: Fixes for replicas tracking
authorKent Overstreet <kent.overstreet@gmail.com>
Thu, 22 Aug 2019 17:20:38 +0000 (13:20 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:26 +0000 (17:08 -0400)
commitdf5d4dae0b667f93616d6e47da09ad916dcb7102
treeabf45721054c25b75aab9bae48c409299ad36315
parent6671a7089fdcdd8f25f6b4729fdc066f7c42edfd
bcachefs: Fixes for replicas tracking

The continue statement in bch2_trans_mark_extent() was wrong - by
bailing out early, we'd be constructing the wrong replicas list to
update. Also, the assertion in update_replicas() was wrong - due to
rounding with compressed extents, it is possible for sectors to be 0
sometimes.

Also, change extent_to_replicas() in replicas.c to match the replicas
list we construct in buckets.c.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/buckets.c
fs/bcachefs/replicas.c