From 525f8c64b0b9b3726980306051e91d9f5c8e7ff1 Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Wed, 13 Aug 2003 09:12:28 -0700 Subject: [PATCH] [PATCH] sync iocb wakeup if ki_users = 1, we don't do the wakeup, which seems wrong. --- fs/aio.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/aio.c b/fs/aio.c index 1232d3ed8e5df..19b5acbbbcf91 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -639,13 +639,13 @@ int aio_complete(struct kiocb *iocb, long res, long res2) 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; -- 2.53.0