From: Kent Overstreet Date: Tue, 11 Oct 2022 08:49:23 +0000 (-0400) Subject: bcachefs: Fix cached data accounting X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=5b3243cb528f96e5d90d65f56f96ad179c666ff5;p=linux.git 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 --- diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c index 4b041707cd54b..5cb4a00166f93 100644 --- a/fs/bcachefs/buckets.c +++ b/fs/bcachefs/buckets.c @@ -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");