mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: davej@redhat.com
To: torvalds@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] sync iocb wakeup
Date: Mon, 11 Aug 2003 17:48:56 +0100	[thread overview]
Message-ID: <E19mFqq-00067z-00@tetrachloride> (raw)

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;

                 reply	other threads:[~2003-08-11 16:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E19mFqq-00067z-00@tetrachloride \
    --to=davej@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®