From 63266a2ff3000d052162d9b5a26051c9eeee2431 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 20 May 2025 10:52:34 +0200 Subject: [PATCH] 5.15-stable patches added patches: block-fix-direct-io-nowait-flag-not-work.patch --- ...k-fix-direct-io-nowait-flag-not-work.patch | 44 +++++++++++++++++++ queue-5.15/series | 1 + 2 files changed, 45 insertions(+) create mode 100644 queue-5.15/block-fix-direct-io-nowait-flag-not-work.patch diff --git a/queue-5.15/block-fix-direct-io-nowait-flag-not-work.patch b/queue-5.15/block-fix-direct-io-nowait-flag-not-work.patch new file mode 100644 index 0000000000..f1a290e11e --- /dev/null +++ b/queue-5.15/block-fix-direct-io-nowait-flag-not-work.patch @@ -0,0 +1,44 @@ +From changfengnan@bytedance.com Tue May 20 10:52:04 2025 +From: Fengnan Chang +Date: Tue, 13 May 2025 19:28:04 +0800 +Subject: block: fix direct io NOWAIT flag not work +To: axboe@kernel.dk, gregkh@linuxfoundation.org +Cc: stable@vger.kernel.org, Fengnan Chang +Message-ID: <20250513112804.18731-1-changfengnan@bytedance.com> + +From: Fengnan Chang + +commit 8b44b4d81598 ("block: don't allow multiple bios for IOCB_NOWAIT +issue") backport a upstream fix, but miss commit b77c88c2100c ("block: +pass a block_device and opf to bio_alloc_kiocb"), and introduce this bug. +commit b77c88c2100c ("block: pass a block_device and opf to +bio_alloc_kiocb") have other depend patch, so just fix it. + +Fixes: 8b44b4d81598 ("block: don't allow multiple bios for IOCB_NOWAIT issue") +Signed-off-by: Fengnan Chang +Signed-off-by: Greg Kroah-Hartman +--- + block/fops.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/block/fops.c ++++ b/block/fops.c +@@ -259,7 +259,6 @@ static ssize_t __blkdev_direct_IO(struct + blk_finish_plug(&plug); + return -EAGAIN; + } +- bio->bi_opf |= REQ_NOWAIT; + } + + if (is_read) { +@@ -270,6 +269,10 @@ static ssize_t __blkdev_direct_IO(struct + bio->bi_opf = dio_bio_write_op(iocb); + task_io_account_write(bio->bi_iter.bi_size); + } ++ ++ if (iocb->ki_flags & IOCB_NOWAIT) ++ bio->bi_opf |= REQ_NOWAIT; ++ + dio->size += bio->bi_iter.bi_size; + pos += bio->bi_iter.bi_size; + diff --git a/queue-5.15/series b/queue-5.15/series index 7c0c400610..27dcf82919 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -43,3 +43,4 @@ dmaengine-ti-k3-udma-add-missing-locking.patch dmaengine-ti-k3-udma-use-cap_mask-directly-from-dma_device-structure-instead-of-a-local-copy.patch dmaengine-idxd-fix-memory-leak-in-error-handling-path-of-idxd_setup_engines.patch dmaengine-idxd-fix-memory-leak-in-error-handling-path-of-idxd_setup_groups.patch +block-fix-direct-io-nowait-flag-not-work.patch -- 2.47.3