bcachefs: Array bounds fixes
authorKent Overstreet <kent.overstreet@linux.dev>
Sun, 10 Sep 2023 00:10:11 +0000 (20:10 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:10:12 +0000 (17:10 -0400)
commit5cfd69775eb5460ef78bb5034a37eb0dc52ab65d
tree26a5e49f14d153acbf243df39a75e38ffdc9f3d6
parenta9a7bbab1469f0c427f90c309720c543e37ab110
bcachefs: Array bounds fixes

It's no longer legal to use a zero size array as a flexible array
member - this causes UBSAN to complain.

This patch switches our zero size arrays to normal flexible array
members when possible, and inserts casts in other places (e.g. where we
use the zero size array as a marker partway through an array).

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/bcachefs_format.h
fs/bcachefs/bkey.c
fs/bcachefs/bkey.h
fs/bcachefs/bkey_sort.h
fs/bcachefs/bset.c
fs/bcachefs/btree_io.c
fs/bcachefs/vstructs.h