summaryrefslogtreecommitdiffstats
path: root/fs/erofs/super.c
diff options
context:
space:
mode:
authorGao Xiang <gaoxiang25@huawei.com>2019-09-04 10:09:06 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-09-05 20:10:08 +0200
commite2c71e74b21e4053c18ac99ee93139d0aa95c53a (patch)
tree5b40059ae54484241356188f82736b3dffc7a160 /fs/erofs/super.c
parent99634bf388db04048b83a075358a1d166e7300fb (diff)
downloadlinux-stable-e2c71e74b21e4053c18ac99ee93139d0aa95c53a.tar.gz
linux-stable-e2c71e74b21e4053c18ac99ee93139d0aa95c53a.tar.bz2
linux-stable-e2c71e74b21e4053c18ac99ee93139d0aa95c53a.zip
erofs: kill all erofs specific fault injection
As Christoph suggested [1], "Please just use plain kmalloc everywhere and let the normal kernel error injection code take care of injeting any errors." [1] https://lore.kernel.org/r/20190829102426.GE20598@infradead.org/ Reported-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Gao Xiang <gaoxiang25@huawei.com> Link: https://lore.kernel.org/r/20190904020912.63925-20-gaoxiang25@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/erofs/super.c')
-rw-r--r--fs/erofs/super.c70
1 files changed, 0 insertions, 70 deletions
diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index 36e569a79172..407c95854be1 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -126,63 +126,6 @@ out:
return ret;
}
-#ifdef CONFIG_EROFS_FAULT_INJECTION
-const char *erofs_fault_name[FAULT_MAX] = {
- [FAULT_KMALLOC] = "kmalloc",
- [FAULT_READ_IO] = "read IO error",
-};
-
-static void __erofs_build_fault_attr(struct erofs_sb_info *sbi,
- unsigned int rate)
-{
- struct erofs_fault_info *ffi = &sbi->fault_info;
-
- if (rate) {
- atomic_set(&ffi->inject_ops, 0);
- ffi->inject_rate = rate;
- ffi->inject_type = (1 << FAULT_MAX) - 1;
- } else {
- memset(ffi, 0, sizeof(struct erofs_fault_info));
- }
-
- set_opt(sbi, FAULT_INJECTION);
-}
-
-static int erofs_build_fault_attr(struct erofs_sb_info *sbi,
- substring_t *args)
-{
- int rate = 0;
-
- if (args->from && match_int(args, &rate))
- return -EINVAL;
-
- __erofs_build_fault_attr(sbi, rate);
- return 0;
-}
-
-static unsigned int erofs_get_fault_rate(struct erofs_sb_info *sbi)
-{
- return sbi->fault_info.inject_rate;
-}
-#else
-static void __erofs_build_fault_attr(struct erofs_sb_info *sbi,
- unsigned int rate)
-{
-}
-
-static int erofs_build_fault_attr(struct erofs_sb_info *sbi,
- substring_t *args)
-{
- infoln("fault_injection options not supported");
- return 0;
-}
-
-static unsigned int erofs_get_fault_rate(struct erofs_sb_info *sbi)
-{
- return 0;
-}
-#endif
-
#ifdef CONFIG_EROFS_FS_ZIP
static int erofs_build_cache_strategy(struct erofs_sb_info *sbi,
substring_t *args)
@@ -237,7 +180,6 @@ enum {
Opt_nouser_xattr,
Opt_acl,
Opt_noacl,
- Opt_fault_injection,
Opt_cache_strategy,
Opt_err
};
@@ -247,7 +189,6 @@ static match_table_t erofs_tokens = {
{Opt_nouser_xattr, "nouser_xattr"},
{Opt_acl, "acl"},
{Opt_noacl, "noacl"},
- {Opt_fault_injection, "fault_injection=%u"},
{Opt_cache_strategy, "cache_strategy=%s"},
{Opt_err, NULL}
};
@@ -301,11 +242,6 @@ static int erofs_parse_options(struct super_block *sb, char *options)
infoln("noacl options not supported");
break;
#endif
- case Opt_fault_injection:
- err = erofs_build_fault_attr(EROFS_SB(sb), args);
- if (err)
- return err;
- break;
case Opt_cache_strategy:
err = erofs_build_cache_strategy(EROFS_SB(sb), args);
if (err)
@@ -593,9 +529,6 @@ static int erofs_show_options(struct seq_file *seq, struct dentry *root)
else
seq_puts(seq, ",noacl");
#endif
- if (test_opt(sbi, FAULT_INJECTION))
- seq_printf(seq, ",fault_injection=%u",
- erofs_get_fault_rate(sbi));
#ifdef CONFIG_EROFS_FS_ZIP
if (sbi->cache_strategy == EROFS_ZIP_CACHE_DISABLED) {
seq_puts(seq, ",cache_strategy=disabled");
@@ -615,7 +548,6 @@ static int erofs_remount(struct super_block *sb, int *flags, char *data)
{
struct erofs_sb_info *sbi = EROFS_SB(sb);
unsigned int org_mnt_opt = sbi->mount_opt;
- unsigned int org_inject_rate = erofs_get_fault_rate(sbi);
int err;
DBG_BUGON(!sb_rdonly(sb));
@@ -631,9 +563,7 @@ static int erofs_remount(struct super_block *sb, int *flags, char *data)
*flags |= SB_RDONLY;
return 0;
out:
- __erofs_build_fault_attr(sbi, org_inject_rate);
sbi->mount_opt = org_mnt_opt;
-
return err;
}