https://github.com/torvalds/linux
Revision eacc6dfaea963ef61540abb31ad7829be5eff284 authored by Jens Axboe on 07 January 2020, 20:08:56 UTC, committed by Jens Axboe on 07 January 2020, 20:08:56 UTC
We currently punt any short read on a regular file to async context,
but this fails if the short read is due to running into EOF. This is
especially problematic since we only do the single prep for commands
now, as we don't reset kiocb->ki_pos. This can result in a 4k read on
a 1k file returning zero, as we detect the short read and then retry
from async context. At the time of retry, the position is now 1k, and
we end up reading nothing, and hence return 0.

Instead of trying to patch around the fact that short reads can be
legitimate and won't succeed in case of retry, remove the logic to punt
a short read to async context. Simply return it.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent fd1c4bc
History
Tip revision: eacc6dfaea963ef61540abb31ad7829be5eff284 authored by Jens Axboe on 07 January 2020, 20:08:56 UTC
io_uring: remove punt of short reads to async context
Tip revision: eacc6df
File Mode Size
ABI
EDID
PCI
RCU
accounting
admin-guide
arm
arm64
block
bpf
cdrom
core-api
cpu-freq
crypto
dev-tools
devicetree
doc-guide
driver-api
fault-injection
fb
features
filesystems
firmware-guide
firmware_class
fpga
gpu
hid
hwmon
i2c
ia64
ide
iio
infiniband
input
isdn
kbuild
kernel-hacking
leds
livepatch
locking
m68k
maintainer
media
mic
mips
misc-devices
netlabel
networking
nios2
nvdimm
openrisc
parisc
pcmcia
power
powerpc
process
riscv
s390
scheduler
scsi
security
sh
sound
sparc
sphinx
sphinx-static
spi
target
timers
trace
translations
usb
userspace-api
virt
virtual
vm
w1
watchdog
x86
xtensa
.gitignore -rw-r--r-- 13 bytes
COPYING-logo -rw-r--r-- 563 bytes
Changes l--------- 19 bytes
CodingStyle -rw-r--r-- 48 bytes
DMA-API-HOWTO.txt -rw-r--r-- 32.8 KB
DMA-API.txt -rw-r--r-- 27.3 KB
DMA-ISA-LPC.txt -rw-r--r-- 5.1 KB
DMA-attributes.txt -rw-r--r-- 6.0 KB
IPMI.txt -rw-r--r-- 29.7 KB
IRQ-affinity.txt -rw-r--r-- 2.5 KB
IRQ-domain.txt -rw-r--r-- 10.9 KB
IRQ.txt -rw-r--r-- 994 bytes
Kconfig -rw-r--r-- 360 bytes
Makefile -rw-r--r-- 5.3 KB
SubmittingPatches -rw-r--r-- 54 bytes
asm-annotations.rst -rw-r--r-- 9.1 KB
atomic_bitops.txt -rw-r--r-- 1.5 KB
atomic_t.txt -rw-r--r-- 6.9 KB
bus-virt-phys-mapping.txt -rw-r--r-- 8.0 KB
conf.py -rw-r--r-- 20.4 KB
crc32.txt -rw-r--r-- 8.6 KB
debugging-modules.txt -rw-r--r-- 954 bytes
debugging-via-ohci1394.txt -rw-r--r-- 7.5 KB
digsig.txt -rw-r--r-- 3.0 KB
docutils.conf -rw-r--r-- 159 bytes
dontdiff -rw-r--r-- 2.6 KB
futex-requeue-pi.txt -rw-r--r-- 5.1 KB
hwspinlock.txt -rw-r--r-- 15.1 KB
index.rst -rw-r--r-- 4.0 KB
io-mapping.txt -rw-r--r-- 3.3 KB
io_ordering.txt -rw-r--r-- 2.0 KB
irqflags-tracing.txt -rw-r--r-- 2.3 KB
kobject.txt -rw-r--r-- 18.5 KB
kprobes.txt -rw-r--r-- 30.3 KB
kref.txt -rw-r--r-- 8.9 KB
logo.gif -rw-r--r-- 16.0 KB
lzo.txt -rw-r--r-- 9.1 KB
mailbox.txt -rw-r--r-- 4.4 KB
memory-barriers.txt -rw-r--r-- 114.2 KB
nommu-mmap.txt -rw-r--r-- 12.4 KB
padata.txt -rw-r--r-- 7.3 KB
percpu-rw-semaphore.txt -rw-r--r-- 1.1 KB
pi-futex.txt -rw-r--r-- 5.7 KB
preempt-locking.txt -rw-r--r-- 5.5 KB
rbtree.txt -rw-r--r-- 14.8 KB
remoteproc.txt -rw-r--r-- 12.8 KB
robust-futex-ABI.txt -rw-r--r-- 8.7 KB
robust-futexes.txt -rw-r--r-- 9.5 KB
rpmsg.txt -rw-r--r-- 13.1 KB
speculation.txt -rw-r--r-- 2.8 KB
static-keys.txt -rw-r--r-- 13.0 KB
tee.txt -rw-r--r-- 5.2 KB
this_cpu_ops.txt -rw-r--r-- 11.2 KB
unaligned-memory-access.txt -rw-r--r-- 10.4 KB
xz.txt -rw-r--r-- 5.5 KB

back to top