bcachefs: Fix shift-by-64 in bch2_bkey_format_validate()
authorKent Overstreet <kent.overstreet@gmail.com>
Thu, 24 Jun 2021 17:19:25 +0000 (13:19 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:07 +0000 (17:09 -0400)
commitfdc6b08451167bfc1ae260b252ad2bf2f9735f50
tree59a1d016ed2255d877644b257d64ba9a54268be5
parent78d66ab1ca541ba95a9ad89780466398b348c230
bcachefs: Fix shift-by-64 in bch2_bkey_format_validate()

We need to ensure that packed formats can't represent fields larger than
the unpacked format, which is a bit tricky since the calculations can
also overflow a u64. This patch fixes a shift and simplifies the overall
calculations.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/bkey.c