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: Chengguang Xu <[email protected]>
Reviewed-by: Chao Yu <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
Chengguang Xu authored and Greg Kroah-Hartman committed 2018-09-14 09:05:03 +02:00
1 parent 7dd68b147d
commit 064ee3c0da
1 file changed
+6 -4
+6 -4
View File
@@ -237,16 +237,18 @@ static int parse_options(struct super_block *sb, char *options)
infoln("noacl options not supported");
break;
#endif
#ifdef CONFIG_EROFS_FAULT_INJECTION
case Opt_fault_injection:
if (args->from && match_int(args, &arg))
return -EINVAL;
#ifdef CONFIG_EROFS_FAULT_INJECTION
erofs_build_fault_attr(EROFS_SB(sb), arg);
set_opt(EROFS_SB(sb), FAULT_INJECTION);
#else
infoln("FAULT_INJECTION was not selected");
#endif
break;
#else
case Opt_fault_injection:
infoln("fault_injection options not supported");
break;
#endif
default:
errln("Unrecognized mount option \"%s\" "
"or missing value", p);