Skip to content

Commit a2d79c7

Browse files
committed
Merge tag 'for-5.3/io_uring-20190711' of git://git.kernel.dk/linux-block
Pull io_uring updates from Jens Axboe: "This contains: - Support for recvmsg/sendmsg as first class opcodes. I don't envision going much further down this path, as there are plans in progress to support potentially any system call in an async fashion through io_uring. But I think it does make sense to have certain core ops available directly, especially those that can support a "try this non-blocking" flag/mode. (me) - Handle generic short reads automatically. This can happen fairly easily if parts of the buffered read is cached. Since the application needs to issue another request for the remainder, just do this internally and save kernel/user roundtrip while providing a nicer more robust API. (me) - Support for linked SQEs. This allows SQEs to depend on each other, enabling an application to eg queue a read-from-this-file,write-to-that-file pair. (me) - Fix race in stopping SQ thread (Jackie)" * tag 'for-5.3/io_uring-20190711' of git://git.kernel.dk/linux-block: io_uring: fix io_sq_thread_stop running in front of io_sq_thread io_uring: add support for recvmsg() io_uring: add support for sendmsg() io_uring: add support for sqe links io_uring: punt short reads to async context uio: make import_iovec()/compat_import_iovec() return bytes on success
2 parents 964a4ea + a4c0b3d commit a2d79c7

9 files changed

Lines changed: 330 additions & 76 deletions

File tree

‎fs/aio.c‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,8 +1479,9 @@ static int aio_prep_rw(struct kiocb *req, const struct iocb *iocb)
14791479
return 0;
14801480
}
14811481

1482-
static int aio_setup_rw(int rw, const struct iocb *iocb, struct iovec **iovec,
1483-
bool vectored, bool compat, struct iov_iter *iter)
1482+
static ssize_t aio_setup_rw(int rw, const struct iocb *iocb,
1483+
struct iovec **iovec, bool vectored, bool compat,
1484+
struct iov_iter *iter)
14841485
{
14851486
void __user *buf = (void __user *)(uintptr_t)iocb->aio_buf;
14861487
size_t len = iocb->aio_nbytes;
@@ -1537,7 +1538,7 @@ static int aio_read(struct kiocb *req, const struct iocb *iocb,
15371538
return -EINVAL;
15381539

15391540
ret = aio_setup_rw(READ, iocb, &iovec, vectored, compat, &iter);
1540-
if (ret)
1541+
if (ret < 0)
15411542
return ret;
15421543
ret = rw_verify_area(READ, file, &req->ki_pos, iov_iter_count(&iter));
15431544
if (!ret)
@@ -1565,7 +1566,7 @@ static int aio_write(struct kiocb *req, const struct iocb *iocb,
15651566
return -EINVAL;
15661567

15671568
ret = aio_setup_rw(WRITE, iocb, &iovec, vectored, compat, &iter);
1568-
if (ret)
1569+
if (ret < 0)
15691570
return ret;
15701571
ret = rw_verify_area(WRITE, file, &req->ki_pos, iov_iter_count(&iter));
15711572
if (!ret) {

0 commit comments

Comments
 (0)