summaryrefslogtreecommitdiff
path: root/fs/bcachefs/alloc_background.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-05-20 02:20:28 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:10:01 -0400
commitfaa62a2036a491a919deffd980abc867be51b6f1 (patch)
tree6443e98ef99254b75bf4325d3eb3fa4a5fc76b02 /fs/bcachefs/alloc_background.c
parenta49bd8c007e4f4840f8c4d7fe7d62c7bdc7fffca (diff)
bcachefs: alloc_v4_u64s() fix
With the recent bkey_ops.min_val_size addition, bkey values are automatically extended to the size of the current version. The check in bch2_alloc_v4_invalid() needs to be updated to take this into account. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/alloc_background.c')
-rw-r--r--fs/bcachefs/alloc_background.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c
index dcdef3bcd4c4..f774a660a681 100644
--- a/fs/bcachefs/alloc_background.c
+++ b/fs/bcachefs/alloc_background.c
@@ -269,9 +269,9 @@ int bch2_alloc_v4_invalid(const struct bch_fs *c, struct bkey_s_c k,
struct bkey_s_c_alloc_v4 a = bkey_s_c_to_alloc_v4(k);
int rw = flags & WRITE;
- if (alloc_v4_u64s(a.v) != bkey_val_u64s(k.k)) {
- prt_printf(err, "bad val size (%lu != %u)",
- bkey_val_u64s(k.k), alloc_v4_u64s(a.v));
+ if (alloc_v4_u64s(a.v) > bkey_val_u64s(k.k)) {
+ prt_printf(err, "bad val size (%u > %lu)",
+ alloc_v4_u64s(a.v), bkey_val_u64s(k.k));
return -BCH_ERR_invalid_bkey;
}