Commit 08d62873 authored by ZhaoLong Wang's avatar ZhaoLong Wang Committed by Zheng Zengkai
Browse files

mtd: Add several functions to the fail_function list

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I60L5U


CVE: NA

-----------------------------------------

add mtd_read() mtd_write() mtd_erase() to fail_function list for
testing purpose

Signed-off-by: default avatarZhaoLong Wang <wangzhaolong1@huawei.com>
Reviewed-by: default avatarZhihao Cheng <chengzhihao1@huawei.com>
Reviewed-by: default avatarZhang Yi <yi.zhang@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent e87029a0
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@
#include <linux/leds.h>
#include <linux/debugfs.h>
#include <linux/nvmem-provider.h>
#include <linux/error-injection.h>

#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
@@ -1160,6 +1161,7 @@ int mtd_erase(struct mtd_info *mtd, struct erase_info *instr)
	return ret;
}
EXPORT_SYMBOL_GPL(mtd_erase);
ALLOW_ERROR_INJECTION(mtd_erase, ERRNO);

/*
 * This stuff for eXecute-In-Place. phys is optional and may be set to NULL.
@@ -1257,6 +1259,7 @@ int mtd_read(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen,
	return ret;
}
EXPORT_SYMBOL_GPL(mtd_read);
ALLOW_ERROR_INJECTION(mtd_read, ERRNO);

int mtd_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen,
	      const u_char *buf)
@@ -1273,6 +1276,7 @@ int mtd_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen,
	return ret;
}
EXPORT_SYMBOL_GPL(mtd_write);
ALLOW_ERROR_INJECTION(mtd_write, ERRNO);

/*
 * In blackbox flight recorder like scenarios we want to make successful writes