Commit 064ee3c0 authored by Chengguang Xu's avatar Chengguang Xu Committed by Greg Kroah-Hartman

staging: erofs: surround fault_injection ralted option parsing using CONFIG_EROFS_FAULT_INJECTION

It's a little bit strange when fault_injection related
option fail with -EINVAL which was already disabled
from config, so surround all fault_injection related option
parsing code using CONFIG_EROFS_FAULT_INJECTION. Meanwhile,
slightly change warning message to keep consistency with
option POSIX_ACL and FS_XATTR.
Signed-off-by: default avatarChengguang Xu <cgxu519@gmx.com>
Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7dd68b14
...@@ -237,16 +237,18 @@ static int parse_options(struct super_block *sb, char *options) ...@@ -237,16 +237,18 @@ static int parse_options(struct super_block *sb, char *options)
infoln("noacl options not supported"); infoln("noacl options not supported");
break; break;
#endif #endif
#ifdef CONFIG_EROFS_FAULT_INJECTION
case Opt_fault_injection: case Opt_fault_injection:
if (args->from && match_int(args, &arg)) if (args->from && match_int(args, &arg))
return -EINVAL; return -EINVAL;
#ifdef CONFIG_EROFS_FAULT_INJECTION
erofs_build_fault_attr(EROFS_SB(sb), arg); erofs_build_fault_attr(EROFS_SB(sb), arg);
set_opt(EROFS_SB(sb), FAULT_INJECTION); set_opt(EROFS_SB(sb), FAULT_INJECTION);
break;
#else #else
infoln("FAULT_INJECTION was not selected"); case Opt_fault_injection:
#endif infoln("fault_injection options not supported");
break; break;
#endif
default: default:
errln("Unrecognized mount option \"%s\" " errln("Unrecognized mount option \"%s\" "
"or missing value", p); "or missing value", p);
......
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