Skip to contentSkip to conversation

fs: aio: initialize .ki_write_stream of read-write request

PATCH Applied Ming Lei 4 participants 4 messages May 7, 2025

Subsystems (3)
lore
Share & tools
lore

Ming Lei

author
#0 lore raw

PATCH 1/1 fs: aio: initialize .ki_write_stream of read-write request

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 <[email protected]>
Cc Keith Busch <[email protected]>
Cc Kanchan Joshi <[email protected]>
Fixes c27683da6406 ("block: expose write streams for block device nodes")
---
 fs/aio.c | 1 +
 1 file changed, 1 insertion(+)
fs/aio.c +1 -0
index 7b976b564cfc..793b7b15ec4b 100644
@@ -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;
Signature · 1 line
2.47.1
maintainer Applied
#3 lore raw
In reply to Ming Lei
Quoted 5 lines · Ming Lei

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,

Signature · 1 line
Jens Axboe