All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Dave Hansen <dave@linux.vnet.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	lkml <linux-kernel@vger.kernel.org>,
	dri-devel@lists.sourceforge.net, Dave Airlie <airlied@gmail.com>,
	Greg KH <greg@kroah.com>, Eric Paris <eparis@redhat.com>
Subject: Re: [PATCH 2.6.33-rc6] idr: revert misallocation bug fix
Date: Thu, 11 Feb 2010 17:52:05 +0900	[thread overview]
Message-ID: <4B73C535.7020405@kernel.org> (raw)
In-Reply-To: <1265317104.11442.29.camel@nimitz>

Hello,

On 02/05/2010 05:58 AM, Dave Hansen wrote:
> Bah.  I just ran into and bisected the X startup problem. :)
> 
> Let me know when you have a proper fix.  I can test on my machine for
> you.

Can you please test the following against the current mainline?

Thanks.

diff --git a/lib/idr.c b/lib/idr.c
index 1cac726..0dc7822 100644
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -156,10 +156,12 @@ static int sub_alloc(struct idr *idp, int *starting_id, struct idr_layer **pa)
 			id = (id | ((1 << (IDR_BITS * l)) - 1)) + 1;
 
 			/* if already at the top layer, we need to grow */
-			if (!(p = pa[l])) {
+			if (id >= 1 << (idp->layers * IDR_BITS)) {
 				*starting_id = id;
 				return IDR_NEED_TO_GROW;
 			}
+			p = pa[l];
+			BUG_ON(!p);
 
 			/* If we need to go up one layer, continue the
 			 * loop; otherwise, restart from the top.


-- 
tejun

      reply	other threads:[~2010-02-11  8:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-04  8:57 [PATCH 2.6.33-rc6] idr: revert misallocation bug fix Tejun Heo
2010-02-04  8:57 ` Tejun Heo
2010-02-04 20:58 ` Dave Hansen
2010-02-11  8:52   ` Tejun Heo [this message]

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=4B73C535.7020405@kernel.org \
    --to=tj@kernel.org \
    --cc=airlied@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=dave@linux.vnet.ibm.com \
    --cc=dri-devel@lists.sourceforge.net \
    --cc=eparis@redhat.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.