diff options
author | Hongbo Li <lihongbo22@huawei.com> | 2024-02-19 20:24:32 +0800 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-02-28 14:33:50 -0500 |
commit | c2a5e4d6828b2f4799b5c557ea0802d24bdbf571 (patch) | |
tree | 9795af2bea3ba5aacfc00082de15419c01e322b1 /fs/bcachefs/journal.c | |
parent | bf85b528ab11ca8a2a80b07564ebfd714805ea53 (diff) |
bcachefs: fix the error code when mounting with incorrect options.
When mount with incorrect options such as:
"mount -t bcachefs -o errors=back /dev/loop1 /mnt/bcachefs/".
It rebacks the error "mount: /mnt/bcachefs: permission denied."
cause bch2_parse_mount_opts returns -1 and bch2_mount throws
it up. This is unreasonable.
The real error message should be like this:
"mount: /mnt/bcachefs: wrong fs type, bad option, bad
superblock on /dev/loop1, missing codepage or helper program,
or other error."
Adding three private error codes for mounting error. Here are:
- BCH_ERR_mount_option as the parent class for option error.
- BCH_ERR_option_name represents the invalid option name.
- BCH_ERR_option_value represents the invalid option value.
Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/journal.c')
0 files changed, 0 insertions, 0 deletions