diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 18:29:54 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-31 12:18:37 -0400 |
commit | 6ddedca2180b095aacca0f628e0d03a32477f68f (patch) | |
tree | 5803ddaeb0620d622de35d9915308c774a8de4cb /fs/bcachefs/opts.c | |
parent | ef435abd6a99206d9bb93462a1b0508e0d876adb (diff) |
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>
Diffstat (limited to 'fs/bcachefs/opts.c')
-rw-r--r-- | fs/bcachefs/opts.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/bcachefs/opts.c b/fs/bcachefs/opts.c index 8294f56e45d5..b7722b623697 100644 --- a/fs/bcachefs/opts.c +++ b/fs/bcachefs/opts.c @@ -294,6 +294,9 @@ int bch2_opt_validate(const struct bch_option *opt, u64 v, struct printbuf *err) return -EINVAL; } + if (opt->fn.validate) + return opt->fn.validate(v, err); + return 0; } |