Linux block layer
 help / color / mirror / Atom feed
From: Ming Lei <tom.leiming@gmail.com>
To: Jens Axboe <axboe@kernel.dk>, linux-block@vger.kernel.org
Cc: Ming Lei <tom.leiming@gmail.com>,
	Caleb Sander Mateos <csander@purestorage.com>,
	Shuah Khan <shuah@kernel.org>,
	linux-kselftest@vger.kernel.org
Subject: [PATCH 2/5] selftests: ublk: complete a striped request with its full length
Date: Sun, 29 Nov 2026 20:39:27 -0600	[thread overview]
Message-ID: <20261130023937.606428-3-tom.leiming@gmail.com> (raw)
In-Reply-To: <20261130023937.606428-1-tom.leiming@gmail.com>

ublk_stripe_io_done() commits the result of the first CQE for the whole
request, though the request may span several stripes. The driver is
about to act on a short result for WRITE and zero copy again, so each
such request would be requeued and its rest redone.

Keep only errors in io->result, and commit the request length if all
stripes succeed.

The removed check of UBLK_U_IO_UNREGISTER_IO_BUF only let the byte count
of a READ/WRITE CQE into io->result. It did nothing for the unregister
itself: its success is zero, which never changes io->result, and its
failure is still recorded.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
 tools/testing/selftests/ublk/stripe.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/ublk/stripe.c b/tools/testing/selftests/ublk/stripe.c
index dca819f5366e..63e3e9ba3608 100644
--- a/tools/testing/selftests/ublk/stripe.c
+++ b/tools/testing/selftests/ublk/stripe.c
@@ -240,11 +240,10 @@ static void ublk_stripe_io_done(struct ublk_thread *t, struct ublk_queue *q,
 	struct ublk_io *io = ublk_get_io(q, tag);
 	int res = cqe->res;
 
-	if (res < 0 || op != ublk_cmd_op_nr(UBLK_U_IO_UNREGISTER_IO_BUF)) {
+	if (res < 0) {
 		if (!io->result)
 			io->result = res;
-		if (res < 0)
-			ublk_err("%s: io failure %d tag %u\n", __func__, res, tag);
+		ublk_err("%s: io failure %d tag %u\n", __func__, res, tag);
 	}
 
 	/* buffer register op is IOSQE_CQE_SKIP_SUCCESS */
-- 
2.56.1


  parent reply	other threads:[~2026-11-30  2:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30  2:39 [PATCH 0/5] ublk: fix completion of short READ/WRITE Ming Lei
2026-11-30  2:39 ` [PATCH 1/5] ublk: fail READ/WRITE if the result from the server is invalid Ming Lei
2026-11-30  2:39 ` Ming Lei [this message]
2026-11-30  2:39 ` [PATCH 3/5] ublk: don't complete a short request in full Ming Lei
2026-11-30  2:39 ` [PATCH 4/5] ublk: fail a short zone append Ming Lei
2026-11-30  2:39 ` [PATCH 5/5] selftests: ublk: test that a short request isn't completed in full Ming Lei

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=20261130023937.606428-3-tom.leiming@gmail.com \
    --to=tom.leiming@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=csander@purestorage.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=shuah@kernel.org \
    /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