|
@@ -587,7 +587,7 @@ int aio_put_req(struct kiocb *req)
|
|
static struct kioctx *lookup_ioctx(unsigned long ctx_id)
|
|
static struct kioctx *lookup_ioctx(unsigned long ctx_id)
|
|
{
|
|
{
|
|
struct mm_struct *mm = current->mm;
|
|
struct mm_struct *mm = current->mm;
|
|
- struct kioctx *ctx = NULL;
|
|
|
|
|
|
+ struct kioctx *ctx, *ret = NULL;
|
|
struct hlist_node *n;
|
|
struct hlist_node *n;
|
|
|
|
|
|
rcu_read_lock();
|
|
rcu_read_lock();
|
|
@@ -595,12 +595,13 @@ static struct kioctx *lookup_ioctx(unsigned long ctx_id)
|
|
hlist_for_each_entry_rcu(ctx, n, &mm->ioctx_list, list) {
|
|
hlist_for_each_entry_rcu(ctx, n, &mm->ioctx_list, list) {
|
|
if (ctx->user_id == ctx_id && !ctx->dead) {
|
|
if (ctx->user_id == ctx_id && !ctx->dead) {
|
|
get_ioctx(ctx);
|
|
get_ioctx(ctx);
|
|
|
|
+ ret = ctx;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
rcu_read_unlock();
|
|
rcu_read_unlock();
|
|
- return ctx;
|
|
|
|
|
|
+ return ret;
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|