]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Merge tag 'io_uring-5.5-20191212' of git://git.kernel.dk/linux-block
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 13 Dec 2019 22:24:54 +0000 (14:24 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 13 Dec 2019 22:24:54 +0000 (14:24 -0800)
Pull io_uring fixes from Jens Axboe:

 - A tweak to IOSQE_IO_LINK (also marked for stable) to allow links that
   don't sever if the result is < 0.

   This is mostly for linked timeouts, where if we ask for a pure
   timeout we always get -ETIME. This makes links useless for that case,
   hence allow a case where it works.

 - Five minor optimizations to fix and improve cases that regressed
   since v5.4.

 - An SQTHREAD locking fix.

 - A sendmsg/recvmsg iov assignment fix.

 - Net fix where read_iter/write_iter don't honor IOCB_NOWAIT, and
   subsequently ensuring that works for io_uring.

 - Fix a case where for an invalid opcode we might return -EBADF instead
   of -EINVAL, if the ->fd of that sqe was set to an invalid fd value.

* tag 'io_uring-5.5-20191212' of git://git.kernel.dk/linux-block:
  io_uring: ensure we return -EINVAL on unknown opcode
  io_uring: add sockets to list of files that support non-blocking issue
  net: make socket read/write_iter() honor IOCB_NOWAIT
  io_uring: only hash regular files for async work execution
  io_uring: run next sqe inline if possible
  io_uring: don't dynamically allocate poll data
  io_uring: deferred send/recvmsg should assign iov
  io_uring: sqthread should grab ctx->uring_lock for submissions
  io-wq: briefly spin for new work after finishing work
  io-wq: remove worker->wait waitqueue
  io_uring: allow unbreakable links

1  2 
net/socket.c

diff --combined net/socket.c
index 4d38d49d6ad91508d4d6cccbc79318c6a5f3f73e,b116e58d6438f12854392a8ced64cc8a812119d4..50623218747f067c0ecf33a51d8d6b61e39ce139
@@@ -957,7 -957,7 +957,7 @@@ static ssize_t sock_read_iter(struct ki
                             .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)
@@@ -982,7 -982,7 +982,7 @@@ static ssize_t sock_write_iter(struct k
        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)
@@@ -2546,12 -2546,7 +2546,12 @@@ static int ____sys_recvmsg(struct socke
  
        if (sock->file->f_flags & O_NONBLOCK)
                flags |= MSG_DONTWAIT;
 -      err = (nosec ? sock_recvmsg_nosec : sock_recvmsg)(sock, msg_sys, flags);
 +
 +      if (unlikely(nosec))
 +              err = sock_recvmsg_nosec(sock, msg_sys, flags);
 +      else
 +              err = sock_recvmsg(sock, msg_sys, flags);
 +
        if (err < 0)
                goto out;
        len = err;