This commit is contained in:
Christoph Hellwig 2018-05-26 09:16:25 +02:00
commit ed0d523adb
26 changed files with 153 additions and 120 deletions

View file

@ -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();