]> www.infradead.org Git - users/willy/xarray.git/commitdiff
io_uring: grab any needed state during defer prep
authorJens Axboe <axboe@kernel.dk>
Sat, 12 Sep 2020 19:18:10 +0000 (13:18 -0600)
committerJens Axboe <axboe@kernel.dk>
Sun, 13 Sep 2020 20:47:06 +0000 (14:47 -0600)
Always grab work environment for deferred links. The assumption that we
will be running it always from the task in question is false, as exiting
tasks may mean that we're deferring this one to a thread helper. And at
that point it's too late to grab the work environment.

Fixes: debb85f496c9 ("io_uring: factor out grab_env() from defer_prep()")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c

index 175fb647d099bd8d4783a4ee0f5e296927f79dae..be9d628e7854ce52600fe75ab11f0497d984fd8f 100644 (file)
@@ -5449,6 +5449,8 @@ static int io_req_defer_prep(struct io_kiocb *req,
        if (unlikely(ret))
                return ret;
 
+       io_prep_async_work(req);
+
        switch (req->opcode) {
        case IORING_OP_NOP:
                break;