bcachefs: Fix bch2_replicas_gc2

This fixes a regression introduced by "bcachefs: Refactor filesystem
usage accounting". We have to include all the replicas entries that have
any of the entries for different journal entries nonzero, we can't skip
them if they sum to zero.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2021-01-10 13:38:09 -05:00 committed by Kent Overstreet
parent 4291a3317f
commit 53ef2c5cc9

View File

@ -607,7 +607,11 @@ retry:
cpu_replicas_entry(&c->replicas, i);
if (e->data_type == BCH_DATA_journal ||
bch2_fs_usage_read_one(c, &c->usage_base->replicas[i]))
c->usage_base->replicas[i] ||
percpu_u64_get(&c->usage[0]->replicas[i]) ||
percpu_u64_get(&c->usage[1]->replicas[i]) ||
percpu_u64_get(&c->usage[2]->replicas[i]) ||
percpu_u64_get(&c->usage[3]->replicas[i]))
memcpy(cpu_replicas_entry(&new, new.nr++),
e, new.entry_size);
}