mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
aio: fix kioctx leak introduced by "aio: Fix a trinity splat"
e34ecee2ae
reworked the percpu reference
counting to correct a bug trinity found. Unfortunately, the change lead
to kioctxes being leaked because there was no final reference count to
put. Add that reference count back in to fix things.
Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>
Cc: stable@vger.kernel.org
This commit is contained in:
parent
b7000adef1
commit
1881686f84
1 changed files with 2 additions and 1 deletions
3
fs/aio.c
3
fs/aio.c
|
@ -652,7 +652,8 @@ static struct kioctx *ioctx_alloc(unsigned nr_events)
|
|||
aio_nr += ctx->max_reqs;
|
||||
spin_unlock(&aio_nr_lock);
|
||||
|
||||
percpu_ref_get(&ctx->users); /* io_setup() will drop this ref */
|
||||
percpu_ref_get(&ctx->users); /* io_setup() will drop this ref */
|
||||
percpu_ref_get(&ctx->reqs); /* free_ioctx_users() will drop this */
|
||||
|
||||
err = ioctx_add_table(ctx, mm);
|
||||
if (err)
|
||||
|
|
Loading…
Reference in a new issue