fs: aio: initialize .ki_write_stream of read-write request
Subsystems (3)
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")
Signed-off-by Ming Lei <[email protected]>
--- fs/aio.c | 1 + 1 file changed, 1 insertion(+)
fs/aio.c +1 -0
@@ -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
Looks good:
Reviewed-by Christoph Hellwig <[email protected]>
Quoted 3 lines · Ming Lei
AIO needs to initialize .ki_write_stream explicitly for read/write request, otherwise random .ki_write_stream is used, and cause
-EINVALreturned for aio write randomly.
Yes, thanks for the catch.
Reviewed-by Keith Busch <[email protected]>
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
-EINVALreturned 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