diff options
Diffstat (limited to 'fs/aio.c')
-rw-r--r-- | fs/aio.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1159,7 +1159,7 @@ static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb, | |||
1159 | } | 1159 | } |
1160 | } | 1160 | } |
1161 | 1161 | ||
1162 | ret = put_user(req->ki_key, &user_iocb->aio_key); | 1162 | ret = put_user(KIOCB_KEY, &user_iocb->aio_key); |
1163 | if (unlikely(ret)) { | 1163 | if (unlikely(ret)) { |
1164 | pr_debug("EFAULT: aio_key\n"); | 1164 | pr_debug("EFAULT: aio_key\n"); |
1165 | goto out_put_req; | 1165 | goto out_put_req; |
@@ -1281,10 +1281,13 @@ static struct kiocb *lookup_kiocb(struct kioctx *ctx, struct iocb __user *iocb, | |||
1281 | 1281 | ||
1282 | assert_spin_locked(&ctx->ctx_lock); | 1282 | assert_spin_locked(&ctx->ctx_lock); |
1283 | 1283 | ||
1284 | if (key != KIOCB_KEY) | ||
1285 | return NULL; | ||
1286 | |||
1284 | /* TODO: use a hash or array, this sucks. */ | 1287 | /* TODO: use a hash or array, this sucks. */ |
1285 | list_for_each(pos, &ctx->active_reqs) { | 1288 | list_for_each(pos, &ctx->active_reqs) { |
1286 | struct kiocb *kiocb = list_kiocb(pos); | 1289 | struct kiocb *kiocb = list_kiocb(pos); |
1287 | if (kiocb->ki_obj.user == iocb && kiocb->ki_key == key) | 1290 | if (kiocb->ki_obj.user == iocb) |
1288 | return kiocb; | 1291 | return kiocb; |
1289 | } | 1292 | } |
1290 | return NULL; | 1293 | return NULL; |