block: don't allow splitting of a REQ_NOWAIT bio
authorJens Axboe <axboe@kernel.dk>
Wed, 4 Jan 2023 15:52:06 +0000 (08:52 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Jan 2023 10:59:18 +0000 (11:59 +0100)
commitb7b9bc93055d69283fe259c38ea9c46a7a6c3421
treedc93550aea7813b31fe12d4d939e73e9e681e476
parente1358c878711041204d9b4ec4e063317d75a0ac1
block: don't allow splitting of a REQ_NOWAIT bio

commit 9cea62b2cbabff8ed46f2df17778b624ad9dd25a upstream.

If we split a bio marked with REQ_NOWAIT, then we can trigger spurious
EAGAIN if constituent parts of that split bio end up failing request
allocations. Parts will complete just fine, but just a single failure
in one of the chained bios will yield an EAGAIN final result for the
parent bio.

Return EAGAIN early if we end up needing to split such a bio, which
allows for saner recovery handling.

Cc: stable@vger.kernel.org # 5.15+
Link: https://github.com/axboe/liburing/issues/766
Reported-by: Michael Kelley <mikelley@microsoft.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
block/blk-merge.c