* [PATCH for-6.16] fs: aio: initialize .ki_write_stream of read-write request
@ 2025-05-07 13:33 Ming Lei
2025-05-07 13:49 ` Christoph Hellwig
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Ming Lei @ 2025-05-07 13:33 UTC (permalink / raw)
To: Jens Axboe, linux-block
Cc: Ming Lei, Christoph Hellwig, Keith Busch, Kanchan Joshi
AIO needs to initialize .ki_write_stream explicitly for read/write request,
otherwise random .ki_write_stream is used, and cause -EINVAL returned for
aio write randomly.
Cc: Christoph Hellwig <hch@lst.de>
Cc: Keith Busch <kbusch@kernel.org>
Cc: Kanchan Joshi <joshi.k@samsung.com>
Fixes: c27683da6406 ("block: expose write streams for block device nodes")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
---
fs/aio.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/aio.c b/fs/aio.c
index 7b976b564cfc..793b7b15ec4b 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1511,6 +1511,7 @@ static int aio_prep_rw(struct kiocb *req, const struct iocb *iocb, int rw_type)
{
int ret;
+ req->ki_write_stream = 0;
req->ki_complete = aio_complete_rw;
req->private = NULL;
req->ki_pos = iocb->aio_offset;
--
2.47.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH for-6.16] fs: aio: initialize .ki_write_stream of read-write request
2025-05-07 13:33 [PATCH for-6.16] fs: aio: initialize .ki_write_stream of read-write request Ming Lei
@ 2025-05-07 13:49 ` Christoph Hellwig
2025-05-07 13:56 ` Keith Busch
2025-05-07 14:02 ` Jens Axboe
2 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2025-05-07 13:49 UTC (permalink / raw)
To: Ming Lei
Cc: Jens Axboe, linux-block, Christoph Hellwig, Keith Busch,
Kanchan Joshi
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH for-6.16] fs: aio: initialize .ki_write_stream of read-write request
2025-05-07 13:33 [PATCH for-6.16] fs: aio: initialize .ki_write_stream of read-write request Ming Lei
2025-05-07 13:49 ` Christoph Hellwig
@ 2025-05-07 13:56 ` Keith Busch
2025-05-07 14:02 ` Jens Axboe
2 siblings, 0 replies; 4+ messages in thread
From: Keith Busch @ 2025-05-07 13:56 UTC (permalink / raw)
To: Ming Lei; +Cc: Jens Axboe, linux-block, Christoph Hellwig, Kanchan Joshi
On Wed, May 07, 2025 at 09:33:28PM +0800, Ming Lei wrote:
> AIO needs to initialize .ki_write_stream explicitly for read/write request,
> otherwise random .ki_write_stream is used, and cause -EINVAL returned for
> aio write randomly.
Yes, thanks for the catch.
Reviewed-by: Keith Busch <kbusch@kernel.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH for-6.16] fs: aio: initialize .ki_write_stream of read-write request
2025-05-07 13:33 [PATCH for-6.16] fs: aio: initialize .ki_write_stream of read-write request Ming Lei
2025-05-07 13:49 ` Christoph Hellwig
2025-05-07 13:56 ` Keith Busch
@ 2025-05-07 14:02 ` Jens Axboe
2 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2025-05-07 14:02 UTC (permalink / raw)
To: linux-block, Ming Lei; +Cc: Christoph Hellwig, Keith Busch, Kanchan Joshi
On Wed, 07 May 2025 21:33:28 +0800, Ming Lei wrote:
> AIO needs to initialize .ki_write_stream explicitly for read/write request,
> otherwise random .ki_write_stream is used, and cause -EINVAL returned for
> aio write randomly.
>
>
Applied, thanks!
[1/1] fs: aio: initialize .ki_write_stream of read-write request
commit: 037af793557ed192b2c10cf2379ac97abacedf55
Best regards,
--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-05-07 14:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-07 13:33 [PATCH for-6.16] fs: aio: initialize .ki_write_stream of read-write request Ming Lei
2025-05-07 13:49 ` Christoph Hellwig
2025-05-07 13:56 ` Keith Busch
2025-05-07 14:02 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox