5.8 io_uring stable
Subsystems (2)
Hi,
Linus just pulled 3 fixes from me - 1+2 should apply directly, here's the 3rd one which will need some love for 5.8-stable. I'm including it below to preempt the failed to apply message :-)
commit fb8d4046d50f77a26570101e5b8a7a026320a610
Author: Jens Axboe <[email protected]> Date: Wed Sep 2 10:19:04 2020 -0600
io_uring: no read/write-retry on -EAGAIN error and O_NONBLOCK marked file
Actually two things that need fixing up here:
- The io_rw_reissue() -EAGAIN retry is explicit to block devices and regular files, so don't ever attempt to do that on other types of files.
- If we hit -EAGAIN on a nonblock marked file, don't arm poll handler for it. It should just complete with -EAGAIN.
fs/io_uring.c +12 -0
@@ -2726,6 +2726,12 @@ static int io_read(struct io_kiocb *req, bool force_nonblock) ret = ret2; goto done; } +/* no retry on NONBLOCK marked file */ +if (req->file->f_flags &O_NONBLOCK ) { + ret = ret2; + goto done; + } +/* some cases will consume bytes even on error returns */ iov_iter_revert (iter, iov_count -iov_iter_count (iter)); ret2 =0 ;
@@ -2869,9 +2875,15 @@ static int io_write(struct io_kiocb *req, bool force_nonblock)*/ if (ret2 == -EOPNOTSUPP && (kiocb->ki_flags &IOCB_NOWAIT )) ret2 = -EAGAIN ; +/* no retry on NONBLOCK marked file */ +if (ret2 == -EAGAIN && (req->file->f_flags &O_NONBLOCK )) { + ret =0 ; + goto done; + }if (!force_nonblock || ret2 != -EAGAIN ) {if ((req->ctx->flags &IORING_SETUP_IOPOLL ) && ret2 == -EAGAIN ) goto copy_iov; +done:kiocb_done (kiocb, ret2); }else { copy_iov:
Signature · 1 line
Jens Axboe
Greg KH
maintainerQuoted 62 lines · Jens Axboe
Hi,
Linus just pulled 3 fixes from me - 1+2 should apply directly, here's the 3rd one which will need some love for 5.8-stable. I'm including it below to preempt the failed to apply message :-)
commit
fb8d4046d50f77a26570101e5b8a7a026320a610Author: Jens Axboe <[email protected]> Date: Wed Sep 2 10:19:04 2020 -0600
io_uring: no read/write-retry on-EAGAINerror andO_NONBLOCKmarked fileActually two things that need fixing up here:
- The
io_rw_reissue()-EAGAINretry is explicit to block devices and regular files, so don't ever attempt to do that on other types of files.- If we hit
-EAGAINon a nonblock marked file, don't arm poll handler for it. It should just complete with-EAGAIN.Reported-by Norman Maurer <[email protected]>Signed-off-by Jens Axboe <[email protected]>fs/io_uring.c +12
-0@@ -2726,6 +2726,12 @@ static int io_read(struct io_kiocb *req, bool force_nonblock) ret = ret2; goto done; } +/* no retry on NONBLOCK marked file */ +if (req->file->f_flags &O_NONBLOCK ) { + ret = ret2; + goto done; + } +/* some cases will consume bytes even on error returns */ iov_iter_revert (iter, iov_count -iov_iter_count (iter)); ret2 =0 ;@@ -2869,9 +2875,15 @@ static int io_write(struct io_kiocb *req, bool force_nonblock)*/ if (ret2 == -EOPNOTSUPP && (kiocb->ki_flags &IOCB_NOWAIT )) ret2 = -EAGAIN ; +/* no retry on NONBLOCK marked file */ +if (ret2 == -EAGAIN && (req->file->f_flags &O_NONBLOCK )) { + ret =0 ; + goto done; + }if (!force_nonblock || ret2 != -EAGAIN ) {if ((req->ctx->flags &IORING_SETUP_IOPOLL ) && ret2 == -EAGAIN ) goto copy_iov; +done:kiocb_done (kiocb, ret2); }else { copy_iov:Signature · 2 lines
-- Jens Axboe
Thanks for the backport, but this didn't apply at all to the 5.8.y tree. What one did you make it against?
thanks,
greg k-h
Quoted 61 lines · Greg KH
Quoted 60 lines · Jens Axboe
Hi,
Linus just pulled 3 fixes from me - 1+2 should apply directly, here's the 3rd one which will need some love for 5.8-stable. I'm including it below to preempt the failed to apply message :-)
commit
fb8d4046d50f77a26570101e5b8a7a026320a610Author: Jens Axboe <[email protected]> Date: Wed Sep 2 10:19:04 2020 -0600
io_uring: no read/write-retry on-EAGAINerror andO_NONBLOCKmarked fileActually two things that need fixing up here:
- The
io_rw_reissue()-EAGAINretry is explicit to block devices and regular files, so don't ever attempt to do that on other types of files.- If we hit
-EAGAINon a nonblock marked file, don't arm poll handler for it. It should just complete with-EAGAIN.Reported-by Norman Maurer <[email protected]>Signed-off-by Jens Axboe <[email protected]>fs/io_uring.c +12
-0@@ -2726,6 +2726,12 @@ static int io_read(struct io_kiocb *req, bool force_nonblock) ret = ret2; goto done; } +/* no retry on NONBLOCK marked file */ +if (req->file->f_flags &O_NONBLOCK ) { + ret = ret2; + goto done; + } +/* some cases will consume bytes even on error returns */ iov_iter_revert (iter, iov_count -iov_iter_count (iter)); ret2 =0 ;@@ -2869,9 +2875,15 @@ static int io_write(struct io_kiocb *req, bool force_nonblock)*/ if (ret2 == -EOPNOTSUPP && (kiocb->ki_flags &IOCB_NOWAIT )) ret2 = -EAGAIN ; +/* no retry on NONBLOCK marked file */ +if (ret2 == -EAGAIN && (req->file->f_flags &O_NONBLOCK )) { + ret =0 ; + goto done; + }if (!force_nonblock || ret2 != -EAGAIN ) {if ((req->ctx->flags &IORING_SETUP_IOPOLL ) && ret2 == -EAGAIN ) goto copy_iov; +done:kiocb_done (kiocb, ret2); }else { copy_iov:
Quoted 6 lines
Quoted 2 lines
Signature · 1 line
Jens AxboeThanks for the backport, but this didn't apply at all to the 5.8.y tree. What one did you make it against?
Oh, might have been because I have a pile of pending 5.8 stable patches... Let me apply to pristine stable, test, and then I'll send it to you.
Signature · 1 line
Jens Axboe
Quoted 69 lines · Jens Axboe
Quoted 61 lines · Greg KH
Quoted 60 lines · Jens Axboe
Hi,
Linus just pulled 3 fixes from me - 1+2 should apply directly, here's the 3rd one which will need some love for 5.8-stable. I'm including it below to preempt the failed to apply message :-)
commit
fb8d4046d50f77a26570101e5b8a7a026320a610Author: Jens Axboe <[email protected]> Date: Wed Sep 2 10:19:04 2020 -0600
io_uring: no read/write-retry on-EAGAINerror andO_NONBLOCKmarked fileActually two things that need fixing up here:
- The
io_rw_reissue()-EAGAINretry is explicit to block devices and regular files, so don't ever attempt to do that on other types of files.- If we hit
-EAGAINon a nonblock marked file, don't arm poll handler for it. It should just complete with-EAGAIN.Reported-by Norman Maurer <[email protected]>Signed-off-by Jens Axboe <[email protected]>fs/io_uring.c +12
-0@@ -2726,6 +2726,12 @@ static int io_read(struct io_kiocb *req, bool force_nonblock) ret = ret2; goto done; } +/* no retry on NONBLOCK marked file */ +if (req->file->f_flags &O_NONBLOCK ) { + ret = ret2; + goto done; + } +/* some cases will consume bytes even on error returns */ iov_iter_revert (iter, iov_count -iov_iter_count (iter)); ret2 =0 ;@@ -2869,9 +2875,15 @@ static int io_write(struct io_kiocb *req, bool force_nonblock)*/ if (ret2 == -EOPNOTSUPP && (kiocb->ki_flags &IOCB_NOWAIT )) ret2 = -EAGAIN ; +/* no retry on NONBLOCK marked file */ +if (ret2 == -EAGAIN && (req->file->f_flags &O_NONBLOCK )) { + ret =0 ; + goto done; + }if (!force_nonblock || ret2 != -EAGAIN ) {if ((req->ctx->flags &IORING_SETUP_IOPOLL ) && ret2 == -EAGAIN ) goto copy_iov; +done:kiocb_done (kiocb, ret2); }else { copy_iov:Quoted 6 lines
Quoted 2 lines
Signature · 1 line
Jens AxboeThanks for the backport, but this didn't apply at all to the 5.8.y tree. What one did you make it against?
Quoted 2 lines
Oh, might have been because I have a pile of pending 5.8 stable patches... Let me apply to pristine stable, test, and then I'll send it to you.
Here it is:
commit d0ea3f3d17cf891244f17f8ceb43d4988c170471
Author: Jens Axboe <[email protected]> Date: Tue Sep 8 07:16:12 2020 -0600
io_uring: no read/write-retry on -EAGAIN error and O_NONBLOCK marked file
Actually two things that need fixing up here:
- The io_rw_reissue() -EAGAIN retry is explicit to block devices and regular files, so don't ever attempt to do that on other types of files.
- If we hit -EAGAIN on a nonblock marked file, don't arm poll handler for it. It should just complete with -EAGAIN.
fs/io_uring.c +13 -0
@@ -2697,8 +2697,15 @@ static int io_read(struct io_kiocb *req, bool force_nonblock)else ret2 = -EINVAL ; +/* no retry on NONBLOCK marked file */ +if (ret2 == -EAGAIN && (req->file->f_flags &O_NONBLOCK )) { + ret =0 ; + goto done; + } +/* Catch -EAGAIN return for forced non-blocking submission */ if (!force_nonblock || ret2 != -EAGAIN ) { + done:kiocb_done (kiocb, ret2); }else { copy_iov:
@@ -2823,7 +2830,13 @@ static int io_write(struct io_kiocb *req, bool force_nonblock)*/ if (ret2 == -EOPNOTSUPP && (kiocb->ki_flags &IOCB_NOWAIT )) ret2 = -EAGAIN ; +/* no retry on NONBLOCK marked file */ +if (ret2 == -EAGAIN && (req->file->f_flags &O_NONBLOCK )) { + ret =0 ; + goto done; + }if (!force_nonblock || ret2 != -EAGAIN ) { +done:kiocb_done (kiocb, ret2); }else { copy_iov:
Signature · 1 line
Jens Axboe
Greg KH
maintainerQuoted 88 lines · Jens Axboe
Quoted 69 lines · Jens Axboe
Quoted 61 lines · Greg KH
Quoted 60 lines · Jens Axboe
Hi,
Linus just pulled 3 fixes from me - 1+2 should apply directly, here's the 3rd one which will need some love for 5.8-stable. I'm including it below to preempt the failed to apply message :-)
commit
fb8d4046d50f77a26570101e5b8a7a026320a610Author: Jens Axboe <[email protected]> Date: Wed Sep 2 10:19:04 2020 -0600
io_uring: no read/write-retry on-EAGAINerror andO_NONBLOCKmarked fileActually two things that need fixing up here:
- The
io_rw_reissue()-EAGAINretry is explicit to block devices and regular files, so don't ever attempt to do that on other types of files.- If we hit
-EAGAINon a nonblock marked file, don't arm poll handler for it. It should just complete with-EAGAIN.Reported-by Norman Maurer <[email protected]>Signed-off-by Jens Axboe <[email protected]>fs/io_uring.c +12
-0@@ -2726,6 +2726,12 @@ static int io_read(struct io_kiocb *req, bool force_nonblock) ret = ret2; goto done; } +/* no retry on NONBLOCK marked file */ +if (req->file->f_flags &O_NONBLOCK ) { + ret = ret2; + goto done; + } +/* some cases will consume bytes even on error returns */ iov_iter_revert (iter, iov_count -iov_iter_count (iter)); ret2 =0 ;@@ -2869,9 +2875,15 @@ static int io_write(struct io_kiocb *req, bool force_nonblock)*/ if (ret2 == -EOPNOTSUPP && (kiocb->ki_flags &IOCB_NOWAIT )) ret2 = -EAGAIN ; +/* no retry on NONBLOCK marked file */ +if (ret2 == -EAGAIN && (req->file->f_flags &O_NONBLOCK )) { + ret =0 ; + goto done; + }if (!force_nonblock || ret2 != -EAGAIN ) {if ((req->ctx->flags &IORING_SETUP_IOPOLL ) && ret2 == -EAGAIN ) goto copy_iov; +done:kiocb_done (kiocb, ret2); }else { copy_iov:Quoted 6 lines
Quoted 2 lines
Signature · 1 line
Jens AxboeThanks for the backport, but this didn't apply at all to the 5.8.y tree. What one did you make it against?
Quoted 2 lines
Oh, might have been because I have a pile of pending 5.8 stable patches... Let me apply to pristine stable, test, and then I'll send it to you.
Here it is:
commit
d0ea3f3d17cf891244f17f8ceb43d4988c170471Author: Jens Axboe <[email protected]> Date: Tue Sep 8 07:16:12 2020 -0600
io_uring: no read/write-retry on-EAGAINerror andO_NONBLOCKmarked fileActually two things that need fixing up here:
- The
io_rw_reissue()-EAGAINretry is explicit to block devices and regular files, so don't ever attempt to do that on other types of files.
Quoted 6 lines
- If we hit
-EAGAINon a nonblock marked file, don't arm poll handler for it. It should just complete with-EAGAIN.Reported-by Norman Maurer <[email protected]>Signed-off-by Jens Axboe <[email protected]>
Much nicer, that worked, thanks!
greg k-h