Linux block layer
 help / color / mirror / Atom feed
* [PATCH blktests] nvme/039: drain udev events before passthru error injection
@ 2026-06-30 10:19 Mateusz Nowicki
  2026-06-30 11:29 ` John Garry
  0 siblings, 1 reply; 4+ messages in thread
From: Mateusz Nowicki @ 2026-06-30 10:19 UTC (permalink / raw)
  To: Shin'ichiro Kawasaki; +Cc: linux-block, Mateusz Nowicki

From: Mateusz Nowicki <Mateusz.Nowicki@posteo.net>

When run repeatedly, nvme/039 fails intermittently with a regular block
read error instead of the expected passthru line, e.g.:

  nvme0n1: Read(0x2) @ LBA 0, 8 blocks, Invalid Command Opcode (sct 0x0 / sc 0x1) DNR

inject_write_fault_on_write() writes LBA 0 of the whole-disk device,
whose release emits a change uevent that makes udev run blkid, reading
LBA 0 asynchronously. The following passthru injection arms a one-shot
fault (times=1); if the stray blkid read races in first it consumes the
fault and is logged via nvme_log_error() (no cdw fields), so the expected
passthru line is never emitted and the test fails.

Drain the pending uevent with udevadm settle before the passthru section.

Signed-off-by: Mateusz Nowicki <Mateusz.Nowicki@posteo.net>
---
 tests/nvme/039 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/nvme/039 b/tests/nvme/039
index 7ca48ec..8c70c5c 100755
--- a/tests/nvme/039
+++ b/tests/nvme/039
@@ -206,6 +206,8 @@ test_device() {
 	inject_invalid_status_on_read "${ns_dev}"
 	inject_write_fault_on_write "${ns_dev}"
 
+	udevadm settle
+
 	if [ -e "$TEST_DEV_SYSFS/passthru_err_log_enabled" ]; then
 		_nvme_passthru_logging_setup "${ns_dev}" "${ctrl_dev}"
 
-- 
2.53.0


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

* Re: [PATCH blktests] nvme/039: drain udev events before passthru error injection
  2026-06-30 10:19 [PATCH blktests] nvme/039: drain udev events before passthru error injection Mateusz Nowicki
@ 2026-06-30 11:29 ` John Garry
  2026-07-08 10:23   ` John Garry
  0 siblings, 1 reply; 4+ messages in thread
From: John Garry @ 2026-06-30 11:29 UTC (permalink / raw)
  To: Mateusz Nowicki, Shin'ichiro Kawasaki; +Cc: linux-block, linux-nvme

+ linux-nvme

On 30/06/2026 11:19, Mateusz Nowicki wrote:
> From: Mateusz Nowicki <Mateusz.Nowicki@posteo.net>
> 
> When run repeatedly, nvme/039 fails intermittently with a regular block
> read error instead of the expected passthru line, e.g.:
> 
>    nvme0n1: Read(0x2) @ LBA 0, 8 blocks, Invalid Command Opcode (sct 0x0 / sc 0x1) DNR

This is not the error which I was seeing, however this change seems to 
make the test pass reliably for the me. I have not debugged why the test 
was intermittently failing for me.

Please also note that I did trigger a kernel warn previously for this 
test and I posted a proposed fix in:

https://lore.kernel.org/linux-nvme/20260630102717.2671475-1-john.g.garry@oracle.com/T/#u

thanks

> 
> inject_write_fault_on_write() writes LBA 0 of the whole-disk device,
> whose release emits a change uevent that makes udev run blkid, reading
> LBA 0 asynchronously. The following passthru injection arms a one-shot
> fault (times=1); if the stray blkid read races in first it consumes the
> fault and is logged via nvme_log_error() (no cdw fields), so the expected
> passthru line is never emitted and the test fails.
> 
> Drain the pending uevent with udevadm settle before the passthru section.
> 
> Signed-off-by: Mateusz Nowicki <Mateusz.Nowicki@posteo.net>
> ---
>   tests/nvme/039 | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/tests/nvme/039 b/tests/nvme/039
> index 7ca48ec..8c70c5c 100755
> --- a/tests/nvme/039
> +++ b/tests/nvme/039
> @@ -206,6 +206,8 @@ test_device() {
>   	inject_invalid_status_on_read "${ns_dev}"
>   	inject_write_fault_on_write "${ns_dev}"
>   
> +	udevadm settle
> +
>   	if [ -e "$TEST_DEV_SYSFS/passthru_err_log_enabled" ]; then
>   		_nvme_passthru_logging_setup "${ns_dev}" "${ctrl_dev}"
>   


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

* Re: [PATCH blktests] nvme/039: drain udev events before passthru error injection
  2026-06-30 11:29 ` John Garry
@ 2026-07-08 10:23   ` John Garry
  2026-07-09  3:22     ` Shin'ichiro Kawasaki
  0 siblings, 1 reply; 4+ messages in thread
From: John Garry @ 2026-07-08 10:23 UTC (permalink / raw)
  To: Mateusz Nowicki, Shin'ichiro Kawasaki; +Cc: linux-block, linux-nvme

On 30/06/2026 12:29, John Garry wrote:
> + linux-nvme

Hi Shin'ichiro,

Can you kindly picking up this change, below?

Thanks!

> 
> On 30/06/2026 11:19, Mateusz Nowicki wrote:
>> From: Mateusz Nowicki <Mateusz.Nowicki@posteo.net>
>>
>> When run repeatedly, nvme/039 fails intermittently with a regular block
>> read error instead of the expected passthru line, e.g.:
>>
>>    nvme0n1: Read(0x2) @ LBA 0, 8 blocks, Invalid Command Opcode (sct 
>> 0x0 / sc 0x1) DNR
> 
> This is not the error which I was seeing, however this change seems to 
> make the test pass reliably for the me. I have not debugged why the test 
> was intermittently failing for me.
> 
> Please also note that I did trigger a kernel warn previously for this 
> test and I posted a proposed fix in:
> 
> https://lore.kernel.org/linux-nvme/20260630102717.2671475-1- 
> john.g.garry@oracle.com/T/#u
> 
> thanks
> 
>>
>> inject_write_fault_on_write() writes LBA 0 of the whole-disk device,
>> whose release emits a change uevent that makes udev run blkid, reading
>> LBA 0 asynchronously. The following passthru injection arms a one-shot
>> fault (times=1); if the stray blkid read races in first it consumes the
>> fault and is logged via nvme_log_error() (no cdw fields), so the expected
>> passthru line is never emitted and the test fails.
>>
>> Drain the pending uevent with udevadm settle before the passthru section.
>>
>> Signed-off-by: Mateusz Nowicki <Mateusz.Nowicki@posteo.net>
>> ---
>>   tests/nvme/039 | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/tests/nvme/039 b/tests/nvme/039
>> index 7ca48ec..8c70c5c 100755
>> --- a/tests/nvme/039
>> +++ b/tests/nvme/039
>> @@ -206,6 +206,8 @@ test_device() {
>>       inject_invalid_status_on_read "${ns_dev}"
>>       inject_write_fault_on_write "${ns_dev}"
>> +    udevadm settle
>> +
>>       if [ -e "$TEST_DEV_SYSFS/passthru_err_log_enabled" ]; then
>>           _nvme_passthru_logging_setup "${ns_dev}" "${ctrl_dev}"
> 


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

* Re: [PATCH blktests] nvme/039: drain udev events before passthru error injection
  2026-07-08 10:23   ` John Garry
@ 2026-07-09  3:22     ` Shin'ichiro Kawasaki
  0 siblings, 0 replies; 4+ messages in thread
From: Shin'ichiro Kawasaki @ 2026-07-09  3:22 UTC (permalink / raw)
  To: John Garry; +Cc: Mateusz Nowicki, linux-block, linux-nvme

On Jul 08, 2026 / 11:23, John Garry wrote:
> On 30/06/2026 12:29, John Garry wrote:
> > + linux-nvme
> 
> Hi Shin'ichiro,
> 
> Can you kindly picking up this change, below?

Hi Mateusz, John, I have applied the patch. Thanks!

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

end of thread, other threads:[~2026-07-09  3:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-30 10:19 [PATCH blktests] nvme/039: drain udev events before passthru error injection Mateusz Nowicki
2026-06-30 11:29 ` John Garry
2026-07-08 10:23   ` John Garry
2026-07-09  3:22     ` Shin'ichiro Kawasaki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox