Skip to contentSkip to conversation

sync iocb wakeup

PATCH New [email protected] 1 participant 1 message Aug 11, 2003

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sync iocb wakeup

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

fs/aio.c +6 -6
diff -urpN --exclude-from=/home/davej/.exclude bk-linus/fs/aio.c linux-2.5/fs/aio.c
@@ -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;