[PATCH] sync iocb wakeup

From: davej
Date: Mon Aug 11 2003 - 11:58:26 EST


if ki_users = 1, we don't do the wakeup, which seems wrong.

diff -urpN --exclude-from=/home/davej/.exclude bk-linus/fs/aio.c linux-2.5/fs/aio.c
--- bk-linus/fs/aio.c 2003-07-11 13:57:40.000000000 +0100
+++ linux-2.5/fs/aio.c 2003-07-16 02:34:59.000000000 +0100
@@ -639,13 +639,13 @@ int aio_complete(struct kiocb *iocb, lon
iocb->ki_user_data = res;
if (iocb->ki_users == 1) {
iocb->ki_users = 0;
- return 1;
+ ret = 1;
+ } else {
+ spin_lock_irq(&ctx->ctx_lock);
+ iocb->ki_users--;
+ ret = (0 == iocb->ki_users);
+ spin_unlock_irq(&ctx->ctx_lock);
}
- spin_lock_irq(&ctx->ctx_lock);
- iocb->ki_users--;
- ret = (0 == iocb->ki_users);
- spin_unlock_irq(&ctx->ctx_lock);
-
/* sync iocbs put the task here for us */
wake_up_process(iocb->ki_user_obj);
return ret;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/