summaryrefslogtreecommitdiffstats
path: root/fs/aio.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-05-26 09:16:25 +0200
committerChristoph Hellwig <hch@lst.de>2018-05-26 09:16:25 +0200
commited0d523adb5d05d6d7feea572c518e86ff8d1e96 (patch)
tree9ff57c35631ce9d82130849775c72acc3a600e2f /fs/aio.c
parent7a074e96dee62586c935c80cecd931431bfdd0be (diff)
parent4faa99965e027cc057c5145ce45fa772caa04e8d (diff)
downloadlinux-ed0d523adb5d05d6d7feea572c518e86ff8d1e96.tar.gz
linux-ed0d523adb5d05d6d7feea572c518e86ff8d1e96.tar.bz2
linux-ed0d523adb5d05d6d7feea572c518e86ff8d1e96.zip
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.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/aio.c b/fs/aio.c
index f3eae5d5771b..1c383bb44b2d 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -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();