diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-04-29 15:49:56 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-05-07 10:32:22 -0700 |
commit | 2c63fead9e372b3b65d1883bb174df6c9820f1dd (patch) | |
tree | 885acae64bc6daf3c08ea10403b0bb36109b9a76 /fs/f2fs/super.c | |
parent | 73faec4d99358b79815866dd660ae2f9f6f9110a (diff) | |
download | lwn-2c63fead9e372b3b65d1883bb174df6c9820f1dd.tar.gz lwn-2c63fead9e372b3b65d1883bb174df6c9820f1dd.zip |
f2fs: inject kmalloc failure
This patch injects kmalloc failure given a fault injection rate.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/super.c')
-rw-r--r-- | fs/f2fs/super.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 22348791700f..9a56f544da3e 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -41,6 +41,11 @@ static struct kset *f2fs_kset; #ifdef CONFIG_F2FS_FAULT_INJECTION u32 f2fs_fault_rate = 0; +atomic_t f2fs_ops; + +char *fault_name[FAULT_MAX] = { + [FAULT_KMALLOC] = "kmalloc", +}; #endif /* f2fs-wide shrinker description */ @@ -447,6 +452,7 @@ static int parse_options(struct super_block *sb, char *options) return -EINVAL; #ifdef CONFIG_F2FS_FAULT_INJECTION f2fs_fault_rate = arg; + atomic_set(&f2fs_ops, 0); #else f2fs_msg(sb, KERN_INFO, "FAULT_INJECTION was not selected"); |