* [PATCH v2] f2fs: surround fault_injection ralted option parsing using CONFIG_F2FS_FAULT_INJECTION
@ 2018-09-10 23:47 Chengguang Xu
2018-09-11 10:30 ` Chao Yu
0 siblings, 1 reply; 2+ messages in thread
From: Chengguang Xu @ 2018-09-10 23:47 UTC (permalink / raw)
To: jaegeuk, yuchao0; +Cc: Chengguang Xu, linux-f2fs-devel
It's a little bit strange when fault_injection related
options fail with -EINVAL which were already disabled
from config, so surround all fault_injection related option
parsing code using CONFIG_F2FS_FAULT_INJECTION. Meanwhile,
slightly change warning message to keep consistency with
option POSIX_ACL and FS_XATTR.
Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
---
v1->v2:
- modify warning message.
fs/f2fs/super.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 896b885f504e..ea6952c62e9f 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -602,28 +602,31 @@ static int parse_options(struct super_block *sb, char *options)
}
F2FS_OPTION(sbi).write_io_size_bits = arg;
break;
+#ifdef CONFIG_F2FS_FAULT_INJECTION
case Opt_fault_injection:
if (args->from && match_int(args, &arg))
return -EINVAL;
-#ifdef CONFIG_F2FS_FAULT_INJECTION
f2fs_build_fault_attr(sbi, arg, F2FS_ALL_FAULT_TYPE);
set_opt(sbi, FAULT_INJECTION);
-#else
- f2fs_msg(sb, KERN_INFO,
- "FAULT_INJECTION was not selected");
-#endif
break;
+
case Opt_fault_type:
if (args->from && match_int(args, &arg))
return -EINVAL;
-#ifdef CONFIG_F2FS_FAULT_INJECTION
f2fs_build_fault_attr(sbi, 0, arg);
set_opt(sbi, FAULT_INJECTION);
+ break;
#else
+ case Opt_fault_injection:
f2fs_msg(sb, KERN_INFO,
- "FAULT_INJECTION was not selected");
-#endif
+ "fault_injection options not supported");
break;
+
+ case Opt_fault_type:
+ f2fs_msg(sb, KERN_INFO,
+ "fault_type options not supported");
+ break;
+#endif
case Opt_lazytime:
sb->s_flags |= SB_LAZYTIME;
break;
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] f2fs: surround fault_injection ralted option parsing using CONFIG_F2FS_FAULT_INJECTION
2018-09-10 23:47 [PATCH v2] f2fs: surround fault_injection ralted option parsing using CONFIG_F2FS_FAULT_INJECTION Chengguang Xu
@ 2018-09-11 10:30 ` Chao Yu
0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2018-09-11 10:30 UTC (permalink / raw)
To: Chengguang Xu, jaegeuk; +Cc: linux-f2fs-devel
On 2018/9/11 7:47, Chengguang Xu wrote:
> It's a little bit strange when fault_injection related
> options fail with -EINVAL which were already disabled
> from config, so surround all fault_injection related option
> parsing code using CONFIG_F2FS_FAULT_INJECTION. Meanwhile,
> slightly change warning message to keep consistency with
> option POSIX_ACL and FS_XATTR.
>
> Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Thanks,
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-09-11 10:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-10 23:47 [PATCH v2] f2fs: surround fault_injection ralted option parsing using CONFIG_F2FS_FAULT_INJECTION Chengguang Xu
2018-09-11 10:30 ` Chao Yu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.