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 v2 0/5] ublk: fix completion of short READ/WRITE
Date: Tue, 1 Dec 2026 03:51:46 -0600 [thread overview]
Message-ID: <20261201095153.1012606-1-tom.leiming@gmail.com> (raw)
Hi Jens,
Since commit a8a79eba22dc ("ublk: lift checks out of
ublk_{,un}map_io()"), a short result from the ublk server is ignored for
WRITE, and for READ on user copy, zero copy, auto buffer registration
and shmem zero copy devices: the request is completed in full.
Patch 1 fixes the kublk stripe target to commit the full length.
Patch 2 fails READ/WRITE with an invalid result, so that partial
completion is safe.
Patch 3 completes a short READ/WRITE by io->res again and requeues the
rest.
Patch 4 fails a short zone append.
Patch 5 adds a selftest covering short write and short read.
V2:
- move the stripe selftest fix to the front (Caleb Sander Mateos)
- check the unlikely short result first in patch 2 (Caleb Sander
Mateos)
- add Reviewed-by
Thanks,
Ming
Ming Lei (5):
selftests: ublk: complete a striped request with its full length
ublk: fail READ/WRITE if the result from the server is invalid
ublk: don't complete a short request in full
ublk: fail a short zone append
selftests: ublk: test that a short request isn't completed in full
drivers/block/ublk_drv.c | 43 ++-
tools/testing/selftests/ublk/Makefile | 1 +
tools/testing/selftests/ublk/stripe.c | 5 +-
tools/testing/selftests/ublk/test_loop_09.sh | 294 +++++++++++++++++++
4 files changed, 334 insertions(+), 9 deletions(-)
create mode 100755 tools/testing/selftests/ublk/test_loop_09.sh
base-commit: 5f22fb20497f4983094131f00a734362300d22d2
--
2.56.1
next reply other threads:[~2026-12-01 9:52 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 9:51 Ming Lei [this message]
2026-12-01 9:51 ` [PATCH v2 1/5] selftests: ublk: complete a striped request with its full length Ming Lei
2026-12-01 9:51 ` [PATCH v2 2/5] ublk: fail READ/WRITE if the result from the server is invalid Ming Lei
2026-12-01 19:57 ` Caleb Sander Mateos
2026-12-01 9:51 ` [PATCH v2 3/5] ublk: don't complete a short request in full Ming Lei
2026-12-01 20:03 ` Caleb Sander Mateos
2026-12-01 9:51 ` [PATCH v2 4/5] ublk: fail a short zone append Ming Lei
2026-12-01 20:04 ` Caleb Sander Mateos
2026-12-02 1:57 ` Ming Lei
2026-12-02 3:33 ` Ming Lei
2026-12-01 9:51 ` [PATCH v2 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=20261201095153.1012606-1-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 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.