linux-stable/block
Jens Axboe 8b44b4d815 block: don't allow multiple bios for IOCB_NOWAIT issue
commit 67d59247d4 upstream.

If we're doing a large IO request which needs to be split into multiple
bios for issue, then we can run into the same situation as the below
marked commit fixes - parts will complete just fine, one or more parts
will fail to allocate a request. This will result in a partially
completed read or write request, where the caller gets EAGAIN even though
parts of the IO completed just fine.

Do the same for large bios as we do for splits - fail a NOWAIT request
with EAGAIN. This isn't technically fixing an issue in the below marked
patch, but for stable purposes, we should have either none of them or
both.

This depends on: 613b14884b ("block: handle bio_split_to_limits() NULL return")

Cc: stable@vger.kernel.org # 5.15+
Fixes: 9cea62b2cb ("block: don't allow splitting of a REQ_NOWAIT bio")
Link: https://github.com/axboe/liburing/issues/766
Reported-and-tested-by: Michael Kelley <mikelley@microsoft.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-10 09:39:55 +01:00
..
partitions block: drop unused includes in <linux/genhd.h> 2022-03-16 14:23:46 +01:00
badblocks.c
bdev.c block: simplify the block device syncing code 2022-04-27 14:38:50 +02:00
bfq-cgroup.c block, bfq: fix uaf for bfqq in bic_set_bfqq() 2023-02-09 11:26:36 +01:00
bfq-iosched.c block, bfq: fix uaf for bfqq in bic_set_bfqq() 2023-02-09 11:26:36 +01:00
bfq-iosched.h bfq: Get rid of __bio_blkcg() usage 2022-06-09 10:23:19 +02:00
bfq-wf2q.c block/bfq_wf2q: correct weight to ioprio 2022-04-08 14:23:55 +02:00
bio-integrity.c block: bio-integrity: Copy flags when bio_integrity_payload is cloned 2023-03-10 09:39:05 +01:00
bio.c block: ensure iov_iter advances for added pages 2022-08-17 14:24:01 +02:00
blk-cgroup-rwstat.c
blk-cgroup-rwstat.h
blk-cgroup.c blk-cgroup: fix missing pd_online_fn() while activating policy 2023-02-06 07:59:00 +01:00
blk-core.c block: fix and cleanup bio_check_ro 2023-02-01 08:27:30 +01:00
blk-crypto-fallback.c
blk-crypto-internal.h
blk-crypto.c
blk-exec.c
blk-flush.c block: Fix fsync always failed if once failed 2022-01-27 11:05:25 +01:00
blk-integrity.c
blk-ioc.c block: fix default IO priority handling again 2022-08-11 13:07:50 +02:00
blk-iocost.c blk-iocost: fix divide by 0 error in calc_lcoefs() 2023-03-10 09:39:46 +01:00
blk-iolatency.c block: don't allow the same type rq_qos add more than once 2022-08-17 14:24:24 +02:00
blk-ioprio.c
blk-ioprio.h
blk-lib.c
blk-map.c block-map: add __GFP_ZERO flag for alloc_page in function bio_copy_kern 2022-03-08 19:12:31 +01:00
blk-merge.c block: handle bio_split_to_limits() NULL return 2023-01-18 11:48:58 +01:00
blk-mq-cpumap.c
blk-mq-debugfs-zoned.c
blk-mq-debugfs.c blk-mq: don't create hctx debugfs dir until q->debugfs_dir is created 2022-08-17 14:23:12 +02:00
blk-mq-debugfs.h
blk-mq-pci.c
blk-mq-rdma.c
blk-mq-sched.c blk-mq: correct stale comment of .get_budget 2023-03-10 09:39:04 +01:00
blk-mq-sched.h
blk-mq-sysfs.c blk-mq: fix possible memleak when register 'hctx' failed 2022-12-31 13:14:43 +01:00
blk-mq-tag.c
blk-mq-tag.h
blk-mq-virtio.c
blk-mq.c blk-mq: avoid sleep in blk_mq_alloc_request_hctx 2023-03-10 09:39:04 +01:00
blk-mq.h
blk-pm.c scsi: block: pm: Always set request queue runtime active in blk_post_runtime_resume() 2022-01-27 11:04:15 +01:00
blk-pm.h
blk-rq-qos.c
blk-rq-qos.h block: don't allow the same type rq_qos add more than once 2022-08-17 14:24:24 +02:00
blk-settings.c
blk-stat.c
blk-stat.h
blk-sysfs.c block: don't delete queue kobject before its children 2022-04-08 14:23:07 +02:00
blk-throttle.c blk-throttle: prevent overflow while calculating wait time 2022-10-26 12:35:47 +02:00
blk-timeout.c
blk-wbt.c blk-wbt: fix that 'rwb->wc' is always set to 1 in wbt_init() 2022-10-26 12:35:54 +02:00
blk-wbt.h
blk-zoned.c
blk.h
bounce.c
bsg-lib.c
bsg.c
disk-events.c
elevator.c block/wbt: fix negative inflight counter when remove scsi device 2022-02-23 12:03:15 +01:00
fops.c block: don't allow multiple bios for IOCB_NOWAIT issue 2023-03-10 09:39:55 +01:00
genhd.c block: clear ->slave_dir when dropping the main slave_dir reference 2022-12-31 13:14:10 +01:00
holder.c block: drop unused includes in <linux/genhd.h> 2022-03-16 14:23:46 +01:00
ioctl.c block/compat_ioctl: fix range check in BLKGETSIZE 2022-04-27 14:39:02 +02:00
ioprio.c block: fix default IO priority handling again 2022-08-11 13:07:50 +02:00
Kconfig
Kconfig.iosched
keyslot-manager.c
kyber-iosched.c
Makefile block: move CONFIG_BLOCK guard to top Makefile 2022-12-14 11:37:30 +01:00
mq-deadline.c block: mq-deadline: Rename deadline_is_seq_writes() 2023-01-24 07:22:49 +01:00
opal_proto.h
sed-opal.c block: sed-opal: kmalloc the cmd/resp buffers 2022-11-26 09:24:35 +01:00
t10-pi.c