]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 May 2025 08:52:34 +0000 (10:52 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 May 2025 08:52:34 +0000 (10:52 +0200)
added patches:
block-fix-direct-io-nowait-flag-not-work.patch

queue-5.15/block-fix-direct-io-nowait-flag-not-work.patch [new file with mode: 0644]
queue-5.15/series

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 (file)
index 0000000..f1a290e
--- /dev/null
@@ -0,0 +1,44 @@
+From changfengnan@bytedance.com  Tue May 20 10:52:04 2025
+From: Fengnan Chang <changfengnan@bytedance.com>
+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 <changfengnan@bytedance.com>
+Message-ID: <20250513112804.18731-1-changfengnan@bytedance.com>
+
+From: Fengnan Chang <changfengnan@bytedance.com>
+
+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 <changfengnan@bytedance.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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;
index 7c0c40061055cbc4b01f163a7a02c8a8406ca9f0..27dcf8291961a02866bb44c59abae94c79dc687f 100644 (file)
@@ -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