public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 5.15.y] block: fix direct io NOWAIT flag not work
@ 2025-05-13 11:28 Fengnan Chang
  2025-05-14 20:14 ` Sasha Levin
  0 siblings, 1 reply; 3+ messages in thread
From: Fengnan Chang @ 2025-05-13 11:28 UTC (permalink / raw)
  To: axboe, gregkh; +Cc: stable, 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 <changfengnan@bytedance.com>
---
 block/fops.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/block/fops.c b/block/fops.c
index 4c8948979921..72da501542f1 100644
--- a/block/fops.c
+++ b/block/fops.c
@@ -259,7 +259,6 @@ static ssize_t __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
 				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 kiocb *iocb, struct iov_iter *iter,
 			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;
 
-- 
2.39.2 (Apple Git-143)


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 5.15.y] block: fix direct io NOWAIT flag not work
  2025-05-13 11:28 [PATCH 5.15.y] block: fix direct io NOWAIT flag not work Fengnan Chang
@ 2025-05-14 20:14 ` Sasha Levin
  2025-05-15  8:49   ` [External] " Fengnan Chang
  0 siblings, 1 reply; 3+ messages in thread
From: Sasha Levin @ 2025-05-14 20:14 UTC (permalink / raw)
  To: stable, changfengnan; +Cc: Sasha Levin

[ Sasha's backport helper bot ]

Hi,

Summary of potential issues:
⚠️ Could not find matching upstream commit

No upstream commit was identified. Using temporary commit for testing.

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-5.15.y       |  Success    |  Success   |

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [External] Re: [PATCH 5.15.y] block: fix direct io NOWAIT flag not work
  2025-05-14 20:14 ` Sasha Levin
@ 2025-05-15  8:49   ` Fengnan Chang
  0 siblings, 0 replies; 3+ messages in thread
From: Fengnan Chang @ 2025-05-15  8:49 UTC (permalink / raw)
  To: Sasha Levin; +Cc: stable

Hi sashal,
I'm not sure what I need to do. This bug only exists at 5.15.y, so I
use the commit id  at 5.15.y branch, not upstream commit.
Should I use upstream commit or just ignore this warning?

Sasha Levin <sashal@kernel.org> 于2025年5月15日周四 04:14写道:
>
> [ Sasha's backport helper bot ]
>
> Hi,
>
> Summary of potential issues:
> ⚠️ Could not find matching upstream commit
>
> No upstream commit was identified. Using temporary commit for testing.
>
> Results of testing on various branches:
>
> | Branch                    | Patch Apply | Build Test |
> |---------------------------|-------------|------------|
> | stable/linux-5.15.y       |  Success    |  Success   |

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-05-15  8:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-13 11:28 [PATCH 5.15.y] block: fix direct io NOWAIT flag not work Fengnan Chang
2025-05-14 20:14 ` Sasha Levin
2025-05-15  8:49   ` [External] " Fengnan Chang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox