mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
net: make socket read/write_iter() honor IOCB_NOWAIT
[ Upstream commit ebfcd8955c0b52eb793bcbc9e71140e3d0cdb228 ] The socket read/write helpers only look at the file O_NONBLOCK. not the iocb IOCB_NOWAIT flag. This breaks users like preadv2/pwritev2 and io_uring that rely on not having the file itself marked nonblocking, but rather the iocb itself. Cc: [email protected] Acked-by: David Miller <[email protected]> Signed-off-by: Jens Axboe <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
ae6e5f8d51
commit
b1954fda6b
1 changed files with 2 additions and 2 deletions
|
|
@ -955,7 +955,7 @@ static ssize_t sock_read_iter(struct kiocb *iocb, struct iov_iter *to)
|
|||
.msg_iocb = iocb};
|
||||
ssize_t res;
|
||||
|
||||
if (file->f_flags & O_NONBLOCK)
|
||||
if (file->f_flags & O_NONBLOCK || (iocb->ki_flags & IOCB_NOWAIT))
|
||||
msg.msg_flags = MSG_DONTWAIT;
|
||||
|
||||
if (iocb->ki_pos != 0)
|
||||
|
|
@ -980,7 +980,7 @@ static ssize_t sock_write_iter(struct kiocb *iocb, struct iov_iter *from)
|
|||
if (iocb->ki_pos != 0)
|
||||
return -ESPIPE;
|
||||
|
||||
if (file->f_flags & O_NONBLOCK)
|
||||
if (file->f_flags & O_NONBLOCK || (iocb->ki_flags & IOCB_NOWAIT))
|
||||
msg.msg_flags = MSG_DONTWAIT;
|
||||
|
||||
if (sock->type == SOCK_SEQPACKET)
|
||||
|
|
|
|||
Loading…
Reference in a new issue