* [PATCH] Documentation: block: fix the sector 0 error injection example
@ 2026-08-15 19:11 Md Haris Iqbal
2026-08-17 6:57 ` Christoph Hellwig
2026-08-17 7:04 ` Tao Cui
0 siblings, 2 replies; 3+ messages in thread
From: Md Haris Iqbal @ 2026-08-15 19:11 UTC (permalink / raw)
To: Jens Axboe
Cc: Christoph Hellwig, Damien Le Moal, Hannes Reinecke, linux-block,
linux-doc, linux-kernel, Md Haris Iqbal
The first error injection example is introduced as failing one in ten
reads of sector 0, but the rule it shows does not set nr_sectors, which
defaults to the remainder of the device. As written it fails one in ten
reads of the whole device.
Add nr_sectors=1 so that the rule does what the text says. This also
gives the documentation one example that uses nr_sectors.
Fixes: e8dcf2d142bd ("block: add configurable error injection")
Signed-off-by: Md Haris Iqbal <haris.iqbal@linux.dev>
---
Documentation/block/error-injection.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/block/error-injection.rst b/Documentation/block/error-injection.rst
--- a/Documentation/block/error-injection.rst
+++ b/Documentation/block/error-injection.rst
@@ -48,7 +48,7 @@ Example
Return BLK_STS_IOERR for one in 10 reads of sector 0 of /dev/nvme0n1:
- $ echo 'add,op=READ,start=0,status=IOERR,chance=10' > /sys/kernel/debug/block/nvme0n1/error_injection
+ $ echo 'add,op=READ,start=0,nr_sectors=1,status=IOERR,chance=10' > /sys/kernel/debug/block/nvme0n1/error_injection
Return BLK_STS_MEDIUM for every write to /dev/nvme0n1:
--
2.53.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Documentation: block: fix the sector 0 error injection example
2026-08-15 19:11 [PATCH] Documentation: block: fix the sector 0 error injection example Md Haris Iqbal
@ 2026-08-17 6:57 ` Christoph Hellwig
2026-08-17 7:04 ` Tao Cui
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2026-08-17 6:57 UTC (permalink / raw)
To: Md Haris Iqbal
Cc: Jens Axboe, Christoph Hellwig, Damien Le Moal, Hannes Reinecke,
linux-block, linux-doc, linux-kernel
On Sat, Aug 15, 2026 at 09:11:00PM +0200, Md Haris Iqbal wrote:
> The first error injection example is introduced as failing one in ten
> reads of sector 0, but the rule it shows does not set nr_sectors, which
> defaults to the remainder of the device. As written it fails one in ten
> reads of the whole device.
>
> Add nr_sectors=1 so that the rule does what the text says. This also
> gives the documentation one example that uses nr_sectors.
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Documentation: block: fix the sector 0 error injection example
2026-08-15 19:11 [PATCH] Documentation: block: fix the sector 0 error injection example Md Haris Iqbal
2026-08-17 6:57 ` Christoph Hellwig
@ 2026-08-17 7:04 ` Tao Cui
1 sibling, 0 replies; 3+ messages in thread
From: Tao Cui @ 2026-08-17 7:04 UTC (permalink / raw)
To: Md Haris Iqbal, Jens Axboe
Cc: cui.tao, Christoph Hellwig, Damien Le Moal, Hannes Reinecke,
linux-block, linux-doc, linux-kernel
在 2026/8/16 03:11, Md Haris Iqbal 写道:
> The first error injection example is introduced as failing one in ten
> reads of sector 0, but the rule it shows does not set nr_sectors, which
> defaults to the remainder of the device. As written it fails one in ten
> reads of the whole device.
>
> Add nr_sectors=1 so that the rule does what the text says. This also
> gives the documentation one example that uses nr_sectors.
>
> Fixes: e8dcf2d142bd ("block: add configurable error injection")
> Signed-off-by: Md Haris Iqbal <haris.iqbal@linux.dev>
> ---
> Documentation/block/error-injection.rst | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Documentation/block/error-injection.rst b/Documentation/block/error-injection.rst
> --- a/Documentation/block/error-injection.rst
> +++ b/Documentation/block/error-injection.rst
> @@ -48,7 +48,7 @@ Example
>
> Return BLK_STS_IOERR for one in 10 reads of sector 0 of /dev/nvme0n1:
>
> - $ echo 'add,op=READ,start=0,status=IOERR,chance=10' > /sys/kernel/debug/block/nvme0n1/error_injection
> + $ echo 'add,op=READ,start=0,nr_sectors=1,status=IOERR,chance=10' > /sys/kernel/debug/block/nvme0n1/error_injection
>
> Return BLK_STS_MEDIUM for every write to /dev/nvme0n1:
>
> --
> 2.53.0
>
>
Reviewed-by: Tao Cui <cuitao@kylinos.cn>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-08-17 7:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-15 19:11 [PATCH] Documentation: block: fix the sector 0 error injection example Md Haris Iqbal
2026-08-17 6:57 ` Christoph Hellwig
2026-08-17 7:04 ` Tao Cui
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.