diff options
author | Christoph Hellwig <hch@lst.de> | 2018-05-26 09:16:25 +0200 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-05-26 09:16:25 +0200 |
commit | ed0d523adb5d05d6d7feea572c518e86ff8d1e96 (patch) | |
tree | 9ff57c35631ce9d82130849775c72acc3a600e2f /fs/aio.c | |
parent | 7a074e96dee62586c935c80cecd931431bfdd0be (diff) | |
parent | 4faa99965e027cc057c5145ce45fa772caa04e8d (diff) |
Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs into aio-base
Diffstat (limited to 'fs/aio.c')
-rw-r--r-- | fs/aio.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -639,9 +639,8 @@ static void free_ioctx_users(struct percpu_ref *ref) while (!list_empty(&ctx->active_reqs)) { req = list_first_entry(&ctx->active_reqs, struct aio_kiocb, ki_list); - - list_del_init(&req->ki_list); kiocb_cancel(req); + list_del_init(&req->ki_list); } spin_unlock_irq(&ctx->ctx_lock); @@ -1074,8 +1073,8 @@ static struct kioctx *lookup_ioctx(unsigned long ctx_id) ctx = rcu_dereference(table->table[id]); if (ctx && ctx->user_id == ctx_id) { - percpu_ref_get(&ctx->users); - ret = ctx; + if (percpu_ref_tryget_live(&ctx->users)) + ret = ctx; } out: rcu_read_unlock(); |