Skip to content

ublk: fix completion of short READ/WRITE

Ming Lei linux-block linux-kselftest stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5ublk: fail READ/WRITE if the result from the server is invaliddrivers/block/ublk_drv.c+13 -32 replies
2/5selftests: ublk: complete a striped request with its full lengthtools/testing/selftests/ublk/stripe.c+2 -31 reply
3/5ublk: don't complete a short request in fulldrivers/block/ublk_drv.c+17 -30 replies
4/5ublk: fail a short zone appenddrivers/block/ublk_drv.c+10 -30 replies
5/5selftests: ublk: test that a short request isn't completed in fulltools/testing/selftests/ublk/Makefile tools/testing/selftests/ublk/test_loop_09.sh+295 -00 replies

Reviews trailers per patch

1 of 5 patches has a Reviewed-by or Acked-by.

PatchCaleb Sander Mateos
1/5
2/5R-b
3/5
4/5
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/5] ublk: fix completion of short READ/WRITE

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 fails READ/WRITE with an invalid result, so that partial completion is safe.

Patch 2 fixes the kublk stripe target to commit the full length.

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.

Thanks,
Ming

Ming Lei (5):
ublk: fail READ/WRITE if the result from the server is invalid
selftests: ublk: complete a striped request with its full length
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

Signature · 1 line
2.56.1