Commit 525f8c64 authored by Dave Jones's avatar Dave Jones Committed by Linus Torvalds

[PATCH] sync iocb wakeup

if ki_users = 1, we don't do the wakeup, which seems wrong.
parent 9d5a6ebb
...@@ -639,13 +639,13 @@ int aio_complete(struct kiocb *iocb, long res, long res2) ...@@ -639,13 +639,13 @@ int aio_complete(struct kiocb *iocb, long res, long res2)
iocb->ki_user_data = res; iocb->ki_user_data = res;
if (iocb->ki_users == 1) { if (iocb->ki_users == 1) {
iocb->ki_users = 0; iocb->ki_users = 0;
return 1; ret = 1;
} } else {
spin_lock_irq(&ctx->ctx_lock); spin_lock_irq(&ctx->ctx_lock);
iocb->ki_users--; iocb->ki_users--;
ret = (0 == iocb->ki_users); ret = (0 == iocb->ki_users);
spin_unlock_irq(&ctx->ctx_lock); spin_unlock_irq(&ctx->ctx_lock);
}
/* sync iocbs put the task here for us */ /* sync iocbs put the task here for us */
wake_up_process(iocb->ki_user_obj); wake_up_process(iocb->ki_user_obj);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment