]> git.baikalelectronics.ru Git - kernel.git/commit
block: don't allow multiple bios for IOCB_NOWAIT issue
authorJens Axboe <axboe@kernel.dk>
Mon, 16 Jan 2023 15:55:53 +0000 (08:55 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:34:02 +0000 (09:34 +0100)
commit34ff6ed2216029183d823f3af69a327500415676
treec7b3d3010bcc9328f140c0190cb7cd351dfa2492
parenta0995a6dfdca8d3835468f785468db2e76eccd0b
block: don't allow multiple bios for IOCB_NOWAIT issue

commit 40a4979ceb070e622edb32ec96eb1d257c351975 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: f63627108f72 ("block: handle bio_split_to_limits() NULL return")

Cc: stable@vger.kernel.org # 5.15+
Fixes: 653ecd505adf ("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>
block/fops.c