diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-12-04 13:03:24 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-12-04 21:46:19 -0500 |
commit | 44a638c34ee6e3dcfe54540e46b78211b1c51144 (patch) | |
tree | a0eebf3717d9fe2086d8d2227022b7e41b7c7f88 | |
parent | d9e407511c98086bfcfadf0c95acca6d4bceb961 (diff) |
bcachefs: BCH_ERR_opt_parse_error
Continuing the project of replacing generic error codes with more
specific ones.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r-- | fs/bcachefs/errcode.h | 1 | ||||
-rw-r--r-- | fs/bcachefs/opts.c | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/fs/bcachefs/errcode.h b/fs/bcachefs/errcode.h index e3e2be7922b9..87c13f137db6 100644 --- a/fs/bcachefs/errcode.h +++ b/fs/bcachefs/errcode.h @@ -174,6 +174,7 @@ x(EINVAL, insufficient_devices_to_start) \ x(EINVAL, invalid) \ x(EINVAL, internal_fsck_err) \ + x(EINVAL, opt_parse_error) \ x(EROFS, erofs_trans_commit) \ x(EROFS, erofs_no_writes) \ x(EROFS, erofs_journal_err) \ diff --git a/fs/bcachefs/opts.c b/fs/bcachefs/opts.c index 8dd4046cca41..8e6f230eac38 100644 --- a/fs/bcachefs/opts.c +++ b/fs/bcachefs/opts.c @@ -279,14 +279,14 @@ int bch2_opt_validate(const struct bch_option *opt, u64 v, struct printbuf *err) if (err) prt_printf(err, "%s: not a multiple of 512", opt->attr.name); - return -EINVAL; + return -BCH_ERR_opt_parse_error; } if ((opt->flags & OPT_MUST_BE_POW_2) && !is_power_of_2(v)) { if (err) prt_printf(err, "%s: must be a power of two", opt->attr.name); - return -EINVAL; + return -BCH_ERR_opt_parse_error; } if (opt->fn.validate) |