diff options
author | Kent Overstreet <koverstreet@google.com> | 2013-03-02 15:25:53 +1100 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2013-03-07 14:27:26 +1100 |
commit | 90c8bf0cef00c912cbbd3e6833a289ae3c9d40b7 (patch) | |
tree | 6e389fa7fb88af60f9d6bdad2af1d21f0ec4e1ba | |
parent | 657df3075ce16006b38fc3b91c30fdc48930d667 (diff) |
aio-kill-ki_retry-fix-fix
The "aio: kill ki-retry" patch was assuming that we didn't touch struct
kiocb after passing it off to something that would call aio_complete() -
which was wrong. So, revert the refcounting changes.
Signed-off-by: Kent Overstreet <koverstreet@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r-- | fs/aio.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -587,7 +587,7 @@ static inline struct kiocb *aio_get_req(struct kioctx *ctx) if (unlikely(!req)) goto out_put; - atomic_set(&req->ki_users, 1); + atomic_set(&req->ki_users, 2); req->ki_ctx = ctx; return req; out_put: @@ -1183,10 +1183,12 @@ static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb, if (ret) goto out_put_req; + aio_put_req(req); /* drop extra ref to req */ return 0; out_put_req: put_reqs_available(ctx, 1); - aio_put_req(req); + aio_put_req(req); /* drop extra ref to req */ + aio_put_req(req); /* drop i/o ref to req */ return ret; } |