Merge branch 'io_uring-5.8' into for-5.9/io_uring
authorJens Axboe <axboe@kernel.dk>
Fri, 26 Jun 2020 19:44:16 +0000 (13:44 -0600)
committerJens Axboe <axboe@kernel.dk>
Fri, 26 Jun 2020 19:44:16 +0000 (13:44 -0600)
Merge in changes that went into 5.8-rc3. GIT will silently do the
merge, but we still need a tweak on top of that since
io_complete_rw_common() was modified to take a io_comp_state pointer.
The auto-merge fails on that, and we end up with something that
doesn't compile.

* io_uring-5.8:
  io_uring: fix current->mm NULL dereference on exit
  io_uring: fix hanging iopoll in case of -EAGAIN
  io_uring: fix io_sq_thread no schedule when busy

Signed-off-by: Jens Axboe <axboe@kernel.dk>
1  2 
fs/io_uring.c

diff --cc fs/io_uring.c
@@@ -905,6 -890,7 +905,8 @@@ static int __io_sqe_files_update(struc
                                 struct io_uring_files_update *ip,
                                 unsigned nr_args);
  static int io_grab_files(struct io_kiocb *req);
 -static void io_complete_rw_common(struct kiocb *kiocb, long res);
++static void io_complete_rw_common(struct kiocb *kiocb, long res,
++                                struct io_comp_state *cs);
  static void io_cleanup_req(struct io_kiocb *req);
  static int io_file_get(struct io_submit_state *state, struct io_kiocb *req,
                       int fd, struct file **out_file, bool fixed);
@@@ -1897,6 -1750,14 +1899,14 @@@ static void io_iopoll_queue(struct list
        do {
                req = list_first_entry(again, struct io_kiocb, list);
                list_del(&req->list);
 -                      io_complete_rw_common(&req->rw.kiocb, -EAGAIN);
+               /* shouldn't happen unless io_uring is dying, cancel reqs */
+               if (unlikely(!current->mm)) {
++                      io_complete_rw_common(&req->rw.kiocb, -EAGAIN, NULL);
+                       io_put_req(req);
+                       continue;
+               }
                refcount_inc(&req->refs);
                io_queue_async_work(req);
        } while (!list_empty(again));