diff options
author | Hongbo Li <lihongbo22@huawei.com> | 2024-03-01 14:38:33 +0800 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-03-13 21:22:26 -0400 |
commit | 2a68d611a17b8135ade5f7016144ef34af0a61a4 (patch) | |
tree | bfd1b9ade6e5ef07fa84b839565bad23aae3c264 /fs/bcachefs/opts.c | |
parent | 7e23c1746b027ea6075816280a4e463a9399d9da (diff) |
bcachefs: intercept mountoption value for bool type
For mount option with bool type, the value must be 0 or 1 (See
bch2_opt_parse). But this seems does not well intercepted cause
for other value(like 2...), it returns the unexpect return code
with error message printed.
Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/opts.c')
-rw-r--r-- | fs/bcachefs/opts.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bcachefs/opts.c b/fs/bcachefs/opts.c index 1db11c15b2b9..08ea0cfc4aef 100644 --- a/fs/bcachefs/opts.c +++ b/fs/bcachefs/opts.c @@ -314,7 +314,7 @@ int bch2_opt_parse(struct bch_fs *c, if (ret < 0 || (*res != 0 && *res != 1)) { if (err) prt_printf(err, "%s: must be bool", opt->attr.name); - return ret; + return ret < 0 ? ret : -BCH_ERR_option_not_bool; } break; case BCH_OPT_UINT: |