linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for-5.7/drivers v2 1/1] null_blk: describe the usage of fault injection param
@ 2020-03-12 22:01 Dongli Zhang
  2020-03-12 22:19 ` Chaitanya Kulkarni
  2020-03-13  0:54 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Dongli Zhang @ 2020-03-12 22:01 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, linux-kernel

As null_blk is a very good start point to test block layer, this patch
adds description and comments to 'timeout', 'requeue' and 'init_hctx' to
explain how to use fault injection with null_blk.

The nvme has similar with nvme_core.fail_request in the form of comment.

Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
---
Changed since v1:
  - rebase at for-5.7/drivers
  - describe 'init_hctx' as well

 drivers/block/null_blk_main.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/block/null_blk_main.c b/drivers/block/null_blk_main.c
index 8060ffa4bc75..b324cc5fcaf7 100644
--- a/drivers/block/null_blk_main.c
+++ b/drivers/block/null_blk_main.c
@@ -97,14 +97,21 @@ module_param_named(home_node, g_home_node, int, 0444);
 MODULE_PARM_DESC(home_node, "Home node for the device");
 
 #ifdef CONFIG_BLK_DEV_NULL_BLK_FAULT_INJECTION
+/*
+ * For more details about fault injection, please refer to
+ * Documentation/fault-injection/fault-injection.rst.
+ */
 static char g_timeout_str[80];
 module_param_string(timeout, g_timeout_str, sizeof(g_timeout_str), 0444);
+MODULE_PARM_DESC(timeout, "Fault injection. timeout=<interval>,<probability>,<space>,<times>");
 
 static char g_requeue_str[80];
 module_param_string(requeue, g_requeue_str, sizeof(g_requeue_str), 0444);
+MODULE_PARM_DESC(requeue, "Fault injection. requeue=<interval>,<probability>,<space>,<times>");
 
 static char g_init_hctx_str[80];
 module_param_string(init_hctx, g_init_hctx_str, sizeof(g_init_hctx_str), 0444);
+MODULE_PARM_DESC(init_hctx, "Fault injection to fail hctx init. init_hctx=<interval>,<probability>,<space>,<times>");
 #endif
 
 static int g_queue_mode = NULL_Q_MQ;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH for-5.7/drivers v2 1/1] null_blk: describe the usage of fault injection param
  2020-03-12 22:01 [PATCH for-5.7/drivers v2 1/1] null_blk: describe the usage of fault injection param Dongli Zhang
@ 2020-03-12 22:19 ` Chaitanya Kulkarni
  2020-03-13  0:54 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Chaitanya Kulkarni @ 2020-03-12 22:19 UTC (permalink / raw)
  To: Dongli Zhang, axboe; +Cc: linux-block, linux-kernel

NVMe does have the same format in host/fault_inject.c.

This description matches what we have in :-

null_setup_fault
	__null_setup_fault()
		setup_fault_attr()

looks good to me.

Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>

On 03/12/2020 03:01 PM, Dongli Zhang wrote:
> As null_blk is a very good start point to test block layer, this patch
> adds description and comments to 'timeout', 'requeue' and 'init_hctx' to
> explain how to use fault injection with null_blk.
>
> The nvme has similar with nvme_core.fail_request in the form of comment.
>
> Signed-off-by: Dongli Zhang<dongli.zhang@oracle.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH for-5.7/drivers v2 1/1] null_blk: describe the usage of fault injection param
  2020-03-12 22:01 [PATCH for-5.7/drivers v2 1/1] null_blk: describe the usage of fault injection param Dongli Zhang
  2020-03-12 22:19 ` Chaitanya Kulkarni
@ 2020-03-13  0:54 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2020-03-13  0:54 UTC (permalink / raw)
  To: Dongli Zhang; +Cc: linux-block, linux-kernel

On 3/12/20 4:01 PM, Dongli Zhang wrote:
> As null_blk is a very good start point to test block layer, this patch
> adds description and comments to 'timeout', 'requeue' and 'init_hctx' to
> explain how to use fault injection with null_blk.
> 
> The nvme has similar with nvme_core.fail_request in the form of comment.

Applied, thanks.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-13  0:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-12 22:01 [PATCH for-5.7/drivers v2 1/1] null_blk: describe the usage of fault injection param Dongli Zhang
2020-03-12 22:19 ` Chaitanya Kulkarni
2020-03-13  0:54 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).