Skip to contentSkip to conversation

Documentation: block: fix the sector 0 error injection example

PATCH In review Md Haris Iqbal 3 participants 3 messages Aug 15 – Aug 17

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Documentation: block: fix the sector 0 error injection example

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")
---
 Documentation/block/error-injection.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/block/error-injection.rst +1 -1
@@ -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 on v1 1/1
#1 lore raw
Quoted 7 lines · 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.

Looks good:

Reviewed-by on v1 1/1
#2 lore raw
In reply to Md Haris Iqbal
Quoted 27 lines · 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")
---
 Documentation/block/error-injection.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/block/error-injection.rst +1 -2
@@ -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:
 
--
Quoted 3 lines

2.53.0