diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-05-20 08:20:28 +0200 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 23:10:01 +0200 |
commit | faa62a2036a491a919deffd980abc867be51b6f1 (patch) | |
tree | 6443e98ef99254b75bf4325d3eb3fa4a5fc76b02 /fs/bcachefs/alloc_background.c | |
parent | bcachefs: Delete an incorrect bch2_trans_unlock() (diff) | |
download | linux-faa62a2036a491a919deffd980abc867be51b6f1.tar.xz linux-faa62a2036a491a919deffd980abc867be51b6f1.zip |
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.c | 6 |
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; } |