Skip to content

Commit

Permalink
aio: fix kioctx leak introduced by "aio: Fix a trinity splat"
Browse files Browse the repository at this point in the history
e34ecee 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 <[email protected]>
Cc: [email protected]
  • Loading branch information
bcrl committed Dec 21, 2013
1 parent b7000ad commit 1881686
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/aio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1881686

Please sign in to comment.