public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Darren Hart <dvhltc@us.ibm.com>
To: Ingo Molnar <mingo@elte.hu>, linux-kernel@vger.kernel.org
Cc: Darren Hart <dvhltc@us.ibm.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Rusty Russell <rusty@au1.ibm.com>
Subject: [PATCH 2/2] futex: correct futex_requeue futex key ref counting in requeue loop
Date: Mon, 29 Dec 2008 10:54:02 -0800	[thread overview]
Message-ID: <20081229185402.10342.77396.stgit@Aeon> (raw)
In-Reply-To: <20081229185238.10342.75651.stgit@Aeon>

The requeue loop takes multiple references to key2, but the corresponding
put loop decrements the refs for key1.  This patch corrects the accounting.

Build and boot tested on an x86_64 system.

Signed-off-by: Darren Hart <dvhltc@us.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Rusty Russell <rusty@au1.ibm.com>
---

 kernel/futex.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/futex.c b/kernel/futex.c
index cf363ce..3b66d91 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -919,7 +919,7 @@ out_unlock:
 
 	/* drop_futex_key_refs() must be called outside the spinlocks. */
 	while (--drop_count >= 0)
-		drop_futex_key_refs(&key1);
+		drop_futex_key_refs(&key2);
 
 	put_futex_key(fshared, &key2);
 out_put_key1:


  parent reply	other threads:[~2008-12-29 18:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-29 18:53 [PATCH 0/2] futex_key reference accounting fixes Darren Hart
2008-12-29 18:53 ` [PATCH 1/2] futex: make futex_(get|put)_key() calls symmetric Darren Hart
2008-12-29 23:49   ` Darren Hart
2008-12-29 18:54 ` Darren Hart [this message]
2008-12-30 23:36   ` [PATCH 2/2] futex: correct futex_requeue futex key ref counting in requeue loop Darren Hart
2009-01-02 22:13     ` Ingo Molnar
2008-12-30  5:39 ` [PATCH 0/2] futex_key reference accounting fixes Ingo Molnar

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=20081229185402.10342.77396.stgit@Aeon \
    --to=dvhltc@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=rusty@au1.ibm.com \
    --cc=tglx@linutronix.de \
    /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