All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/5] ublk: fix completion of short READ/WRITE
@ 2026-12-03  0:32 Ming Lei
  2026-12-03  0:32 ` [PATCH v4 1/5] selftests: ublk: complete a striped request with its full length Ming Lei
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Ming Lei @ 2026-12-03  0:32 UTC (permalink / raw)
  To: Jens Axboe, linux-block
  Cc: Ming Lei, Caleb Sander Mateos, Shuah Khan, linux-kselftest

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.

V4:
	- fail a zone append whose result is larger than the request too,
	  in patch 4 (Caleb Sander Mateos)
	- add ublk_req_is_rw() and ublk_short_rw_valid(), and check the
	  result of READ/WRITE after other requests are ended, in patches
	  2-4
	- narrow the scope of unmapped_bytes and fix the comment in patch 3
	- drop Tested-by from patches 2 and 3 since they are changed

V3:
	- avoid the goto by moving the copy back into the if block, and
	  reword the comment in patch 3 (Caleb Sander Mateos)
	- document why the short zone append check is needed in patch 4
	  (Caleb Sander Mateos)
	- add Reviewed-by and Tested-by

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                     |  85 ++++--
 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, 362 insertions(+), 23 deletions(-)
 create mode 100755 tools/testing/selftests/ublk/test_loop_09.sh


base-commit: 5f22fb20497f4983094131f00a734362300d22d2
-- 
2.56.1


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

end of thread, other threads:[~2026-12-03  0:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03  0:32 [PATCH v4 0/5] ublk: fix completion of short READ/WRITE Ming Lei
2026-12-03  0:32 ` [PATCH v4 1/5] selftests: ublk: complete a striped request with its full length Ming Lei
2026-12-03  0:32 ` [PATCH v4 2/5] ublk: fail READ/WRITE if the result from the server is invalid Ming Lei
2026-12-03  0:32 ` [PATCH v4 3/5] ublk: don't complete a short request in full Ming Lei
2026-12-03  0:32 ` [PATCH v4 4/5] ublk: fail a short zone append Ming Lei
2026-12-03  0:32 ` [PATCH v4 5/5] selftests: ublk: test that a short request isn't completed in full Ming Lei

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.