aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/aio.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/aio.c b/fs/aio.c
index 7556709b9b8d..b167a8dc3a81 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1010,14 +1010,15 @@ static inline struct aio_kiocb *aio_get_req(struct kioctx *ctx)
1010{ 1010{
1011 struct aio_kiocb *req; 1011 struct aio_kiocb *req;
1012 1012
1013 req = kmem_cache_alloc(kiocb_cachep, GFP_KERNEL|__GFP_ZERO); 1013 req = kmem_cache_alloc(kiocb_cachep, GFP_KERNEL);
1014 if (unlikely(!req)) 1014 if (unlikely(!req))
1015 return NULL; 1015 return NULL;
1016 1016
1017 percpu_ref_get(&ctx->reqs); 1017 percpu_ref_get(&ctx->reqs);
1018 req->ki_ctx = ctx;
1018 INIT_LIST_HEAD(&req->ki_list); 1019 INIT_LIST_HEAD(&req->ki_list);
1019 refcount_set(&req->ki_refcnt, 0); 1020 refcount_set(&req->ki_refcnt, 0);
1020 req->ki_ctx = ctx; 1021 req->ki_eventfd = NULL;
1021 return req; 1022 return req;
1022} 1023}
1023 1024
@@ -1732,6 +1733,10 @@ static ssize_t aio_poll(struct aio_kiocb *aiocb, struct iocb *iocb)
1732 if (unlikely(!req->file)) 1733 if (unlikely(!req->file))
1733 return -EBADF; 1734 return -EBADF;
1734 1735
1736 req->head = NULL;
1737 req->woken = false;
1738 req->cancelled = false;
1739
1735 apt.pt._qproc = aio_poll_queue_proc; 1740 apt.pt._qproc = aio_poll_queue_proc;
1736 apt.pt._key = req->events; 1741 apt.pt._key = req->events;
1737 apt.iocb = aiocb; 1742 apt.iocb = aiocb;