Commit 5b3243cb authored by Kent Overstreet's avatar Kent Overstreet

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: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 1f0f731f
......@@ -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");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment