block/io_uring: clarify that short reads can happen
PATCH 1/1 block/io_uring: clarify that short reads can happen
Jens Axboe has confirmed that short reads are rare but can happen:
https://lore.kernel.org/io-uring/YsU%[email protected]/T/#m729963dc577d709b709c191922e98ec79d7eef54
The luring_resubmit_short_read() comment claimed they were only due to a specific io_uring bug that was fixed in Linux commit 9d93a3f5a0c ("io_uring: punt short reads to async context"), which is wrong. Dominique Martinet found that a btrfs bug also causes short reads. There may be more kernel code paths that result in short reads.
Let's consider short reads fair game.
Cc: Dominique Martinet <[email protected]>
Based-on: <[email protected]>
--- block/io_uring.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
block/io_uring.c +2 -6
@@ -73,12 +73,8 @@ static void luring_resubmit(LuringState *s, LuringAIOCB *luringcb)/** * luring_resubmit_short_read: * -* Before Linux commit 9d93a3f5a0c ("io_uring: punt short reads to async -* context") a buffered I/O request with the start of the file range in the -* page cache could result in a short read. Applications need to resubmit the -* remaining read request. -* -* This is a slow path but recent kernels never take it. +* Short reads are rare but may occur. The remaining read request needs to be +* resubmitted. */ static void luring_resubmit_short_read (LuringState *s,LuringAIOCB *luringcb,int nread)
Signature · 1 line
2.36.1
Quoted 40 lines · Stefan Hajnoczi
Jens Axboe has confirmed that short reads are rare but can happen:
https://lore.kernel.org/io-uring/YsU%[email protected]/T/#m729963dc577d709b709c191922e98ec79d7eef54The
luring_resubmit_short_read()comment claimed they were only due to a specificio_uringbug that was fixed in Linux commit9d93a3f5a0c("io_uring: punt short reads to async context"), which is wrong. Dominique Martinet found that a btrfs bug also causes short reads. There may be more kernel code paths that result in short reads.Let's consider short reads fair game.
Cc: Dominique Martinet <[email protected]>
Based-on: <[email protected]>Signed-off-by Stefan Hajnoczi <[email protected]>---
block/io_uring.c| 8 ++------1 file changed, 2 insertions(+), 6 deletions(-)block/io_uring.c +2
-6@@ -73,12 +73,8 @@ static void luring_resubmit(LuringState *s, LuringAIOCB *luringcb)/** * luring_resubmit_short_read: * -* Before Linux commit 9d93a3f5a0c ("io_uring: punt short reads to async -* context") a buffered I/O request with the start of the file range in the -* page cache could result in a short read. Applications need to resubmit the -* remaining read request. -* -* This is a slow path but recent kernels never take it. +* Short reads are rare but may occur. The remaining read request needs to be +* resubmitted. */ static void luring_resubmit_short_read (LuringState *s,LuringAIOCB *luringcb,int nread)Signature · 1 line
2.36.1
Thanks for fixing the comment!
Stefan Hajnoczi
AppliedQuoted 9 lines · Stefan Hajnoczi
Jens Axboe has confirmed that short reads are rare but can happen:
https://lore.kernel.org/io-uring/YsU%[email protected]/T/#m729963dc577d709b709c191922e98ec79d7eef54The
luring_resubmit_short_read()comment claimed they were only due to a specificio_uringbug that was fixed in Linux commit9d93a3f5a0c("io_uring: punt short reads to async context"), which is wrong. Dominique Martinet found that a btrfs bug also causes short reads. There may be more kernel code paths that result in short reads.
Quoted 8 lines
Let's consider short reads fair game.
Cc: Dominique Martinet <[email protected]>
Based-on: <[email protected]>Signed-off-by Stefan Hajnoczi <[email protected]>--- block/io_uring.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
Thanks, applied to my block tree:
https://gitlab.com/stefanha/qemu/commits/block
Stefan