* [PATCH] sync iocb wakeup
@ 2003-08-11 16:48 davej
0 siblings, 0 replies; only message in thread
From: davej @ 2003-08-11 16:48 UTC (permalink / raw)
To: torvalds; +Cc: linux-kernel
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;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-08-11 16:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-11 16:48 [PATCH] sync iocb wakeup davej
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®