diff options
author | Benjamin LaHaise <bcrl@kvack.org> | 2013-12-21 15:49:28 -0500 |
---|---|---|
committer | Benjamin LaHaise <bcrl@kvack.org> | 2013-12-21 15:57:09 -0500 |
commit | 1881686f842065d2f92ec9c6424830ffc17d23b0 (patch) | |
tree | afb359410d2fa889c9e1b60183e677e9af1449d5 | |
parent | b7000adef17a5cce85636e40fa2c2d9851a89e28 (diff) |
aio: fix kioctx leak introduced by "aio: Fix a trinity splat"
e34ecee2ae791df674dfb466ce40692ca6218e43 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
-rw-r--r-- | fs/aio.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -652,7 +652,8 @@ static struct kioctx *ioctx_alloc(unsigned nr_events) | |||
652 | aio_nr += ctx->max_reqs; | 652 | aio_nr += ctx->max_reqs; |
653 | spin_unlock(&aio_nr_lock); | 653 | spin_unlock(&aio_nr_lock); |
654 | 654 | ||
655 | percpu_ref_get(&ctx->users); /* io_setup() will drop this ref */ | 655 | percpu_ref_get(&ctx->users); /* io_setup() will drop this ref */ |
656 | percpu_ref_get(&ctx->reqs); /* free_ioctx_users() will drop this */ | ||
656 | 657 | ||
657 | err = ioctx_add_table(ctx, mm); | 658 | err = ioctx_add_table(ctx, mm); |
658 | if (err) | 659 | if (err) |