bcachefs: Fix cached data accounting

Negating without casting to a signed integer means the value wasn't
getting sign extended properly - oops.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2022-10-11 04:49:23 -04:00
parent 1f0f731ffe
commit 5b3243cb52

View File

@ -578,7 +578,7 @@ int bch2_mark_alloc(struct btree_trans *trans,
if ((flags & BTREE_TRIGGER_BUCKET_INVALIDATE) &&
old_a.cached_sectors) {
ret = update_cached_sectors(c, new, ca->dev_idx,
-old_a.cached_sectors,
-((s64) old_a.cached_sectors),
journal_seq, gc);
if (ret) {
bch2_fs_fatal_error(c, "bch2_mark_alloc(): no replicas entry while updating cached sectors");