From: Zhihao Cheng <chengzhihao1@huawei.com>
To: ZhaoLong Wang <wangzhaolong1@huawei.com>, <richard@nod.at>,
<miquel.raynal@bootlin.com>, <vigneshr@ti.com>
Cc: <linux-mtd@lists.infradead.org>, <linux-kernel@vger.kernel.org>,
<yi.zhang@huawei.com>
Subject: Re: [PATCH V2 5/5] mtd: Add several functions to the fail_function list
Date: Mon, 31 Jul 2023 20:16:16 +0800 [thread overview]
Message-ID: <475deeb5-5517-4784-a9e5-409ef16e42c4@huawei.com> (raw)
In-Reply-To: <20230718085119.3885747-6-wangzhaolong1@huawei.com>
在 2023/7/18 16:51, ZhaoLong Wang 写道:
> add mtd_read(), mtd_write(), mtd_erase(), mtd_block_markbad() to
> fail_function list for testing purpose
>
It could be better if you can provide some examples for how to use these
error injection interfaces.
> Signed-off-by: ZhaoLong Wang <wangzhaolong1@huawei.com>
> ---
> drivers/mtd/mtdcore.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
> index e00b12aa5ec9..ecf1c5e68479 100644
> --- a/drivers/mtd/mtdcore.c
> +++ b/drivers/mtd/mtdcore.c
> @@ -30,6 +30,7 @@
> #include <linux/debugfs.h>
> #include <linux/nvmem-provider.h>
> #include <linux/root_dev.h>
> +#include <linux/error-injection.h>
>
> #include <linux/mtd/mtd.h>
> #include <linux/mtd/partitions.h>
> @@ -1396,6 +1397,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.
> @@ -1493,6 +1495,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)
> @@ -1509,6 +1512,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
> @@ -2329,7 +2333,7 @@ int mtd_block_markbad(struct mtd_info *mtd, loff_t ofs)
> return 0;
> }
> EXPORT_SYMBOL_GPL(mtd_block_markbad);
> -
> +ALLOW_ERROR_INJECTION(mtd_block_markbad, ERRNO);
> /*
> * default_mtd_writev - the default writev method
> * @mtd: mtd device description object pointer
>
prev parent reply other threads:[~2023-07-31 12:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-18 8:51 [PATCH V2 0/5] ubi: Enhanced fault injection capability for the UBI driver ZhaoLong Wang
2023-07-18 8:51 ` [PATCH V2 1/5] ubi: Use the fault injection framework to enhance the fault injection capability ZhaoLong Wang
2023-07-31 11:15 ` Zhihao Cheng
2023-07-18 8:51 ` [PATCH V2 2/5] ubi: Split io_failures into write_failure and erase_failure ZhaoLong Wang
2023-07-31 11:24 ` Zhihao Cheng
2023-07-18 8:51 ` [PATCH V2 3/5] ubi: Add six fault injection type for testing ZhaoLong Wang
2023-07-31 11:57 ` Zhihao Cheng
2023-07-31 12:09 ` Zhihao Cheng
2023-07-31 12:21 ` Zhihao Cheng
2023-07-18 8:51 ` [PATCH V2 4/5] ubi: Reserve sufficient buffer length for the input mask ZhaoLong Wang
2023-07-31 12:13 ` Zhihao Cheng
2023-07-18 8:51 ` [PATCH V2 5/5] mtd: Add several functions to the fail_function list ZhaoLong Wang
2023-07-31 12:16 ` Zhihao Cheng [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=475deeb5-5517-4784-a9e5-409ef16e42c4@huawei.com \
--to=chengzhihao1@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=vigneshr@ti.com \
--cc=wangzhaolong1@huawei.com \
--cc=yi.zhang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®