Commit 56ec287d authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: BCH_ERR_opt_parse_error

Continuing the project of replacing generic error codes with more
specific ones.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 6e92d155
...@@ -175,6 +175,7 @@ ...@@ -175,6 +175,7 @@
x(EINVAL, insufficient_devices_to_start) \ x(EINVAL, insufficient_devices_to_start) \
x(EINVAL, invalid) \ x(EINVAL, invalid) \
x(EINVAL, internal_fsck_err) \ x(EINVAL, internal_fsck_err) \
x(EINVAL, opt_parse_error) \
x(EROFS, erofs_trans_commit) \ x(EROFS, erofs_trans_commit) \
x(EROFS, erofs_no_writes) \ x(EROFS, erofs_no_writes) \
x(EROFS, erofs_journal_err) \ x(EROFS, erofs_journal_err) \
......
...@@ -279,14 +279,14 @@ int bch2_opt_validate(const struct bch_option *opt, u64 v, struct printbuf *err) ...@@ -279,14 +279,14 @@ int bch2_opt_validate(const struct bch_option *opt, u64 v, struct printbuf *err)
if (err) if (err)
prt_printf(err, "%s: not a multiple of 512", prt_printf(err, "%s: not a multiple of 512",
opt->attr.name); 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 ((opt->flags & OPT_MUST_BE_POW_2) && !is_power_of_2(v)) {
if (err) if (err)
prt_printf(err, "%s: must be a power of two", prt_printf(err, "%s: must be a power of two",
opt->attr.name); opt->attr.name);
return -EINVAL; return -BCH_ERR_opt_parse_error;
} }
if (opt->fn.validate) if (opt->fn.validate)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment