Linux block layer
 help / color / mirror / Atom feed
From: Mateusz Nowicki <mateusz.nowicki@posteo.net>
To: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Cc: linux-block@vger.kernel.org,
	Mateusz Nowicki <Mateusz.Nowicki@posteo.net>
Subject: [PATCH blktests] nvme/039: drain udev events before passthru error injection
Date: Tue, 30 Jun 2026 10:19:47 +0000	[thread overview]
Message-ID: <20260630101936.2371-1-mateusz.nowicki@posteo.net> (raw)

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


             reply	other threads:[~2026-06-30 10:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-30 10:19 Mateusz Nowicki [this message]
2026-06-30 11:29 ` [PATCH blktests] nvme/039: drain udev events before passthru error injection John Garry

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=20260630101936.2371-1-mateusz.nowicki@posteo.net \
    --to=mateusz.nowicki@posteo.net \
    --cc=linux-block@vger.kernel.org \
    --cc=shinichiro.kawasaki@wdc.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