On 10/16/21 23:57, Noah Goldstein wrote:
On Sat, Oct 16, 2021 at 5:19 PM Pavel Begunkov <asml.silence@xxxxxxxxx> wrote:
@@ -3238,7 +3220,8 @@ static ssize_t loop_rw_iter(int rw, struct io_kiocb *req, struct iov_iter *iter)
*/
if (kiocb->ki_flags & IOCB_HIPRI)
return -EOPNOTSUPP;
- if (kiocb->ki_flags & IOCB_NOWAIT)
+ if ((kiocb->ki_flags & IOCB_NOWAIT) &&
+ !(kiocb->ki_filp->f_flags & O_NONBLOCK))
return -EAGAIN;
Instead of 2x branches on what appears to be the error (not hot path)
The whole loop_rw_iter() is a slow path, we don't care enough
--
Pavel Begunkov