diff options
author | Tejun Heo <tj@kernel.org> | 2014-06-28 08:10:12 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2014-06-28 08:10:12 -0400 |
commit | 55c6c814ae0aa896781d3c51e4608de542624f64 (patch) | |
tree | d07e2f4d9b5dc9b07d9892cfea9731503fc1bd6b /fs/aio.c | |
parent | 807407c0a29b1e9fe35565f5a671ef3a9dd9f00c (diff) |
percpu-refcount, aio: use percpu_ref_cancel_init() in ioctx_alloc()
ioctx_alloc() reaches inside percpu_ref and directly frees
->pcpu_count in its failure path, which is quite gross. percpu_ref
has been providing a proper interface to do this,
percpu_ref_cancel_init(), for quite some time now. Let's use that
instead.
This patch doesn't introduce any behavior changes.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Benjamin LaHaise <bcrl@kvack.org>
Cc: Kent Overstreet <kmo@daterainc.com>
Diffstat (limited to 'fs/aio.c')
-rw-r--r-- | fs/aio.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -715,8 +715,8 @@ err_ctx: | |||
715 | err: | 715 | err: |
716 | mutex_unlock(&ctx->ring_lock); | 716 | mutex_unlock(&ctx->ring_lock); |
717 | free_percpu(ctx->cpu); | 717 | free_percpu(ctx->cpu); |
718 | free_percpu(ctx->reqs.pcpu_count); | 718 | percpu_ref_cancel_init(&ctx->reqs); |
719 | free_percpu(ctx->users.pcpu_count); | 719 | percpu_ref_cancel_init(&ctx->users); |
720 | kmem_cache_free(kioctx_cachep, ctx); | 720 | kmem_cache_free(kioctx_cachep, ctx); |
721 | pr_debug("error allocating ioctx %d\n", err); | 721 | pr_debug("error allocating ioctx %d\n", err); |
722 | return ERR_PTR(err); | 722 | return ERR_PTR(err); |