bcachefs: Guard against unknown compression options
authorKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 22:29:54 +0000 (18:29 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Tue, 31 Oct 2023 16:18:37 +0000 (12:18 -0400)
commit6ddedca2180b095aacca0f628e0d03a32477f68f
tree5803ddaeb0620d622de35d9915308c774a8de4cb
parentef435abd6a99206d9bb93462a1b0508e0d876adb
bcachefs: Guard against unknown compression options

Since compression options now include compression level, proper
validation is a bit more involved.

This adds bch2_compression_opt_valid(), and plumbs it around
appropriately.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/compress.c
fs/bcachefs/compress.h
fs/bcachefs/errcode.h
fs/bcachefs/inode.c
fs/bcachefs/opts.c
fs/bcachefs/opts.h