From: Jim Houston <jim.houston@ccur.com>
To: Hoang-Nam Nguyen <hnguyen@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, openib-general@openib.org,
Stefan Roscher <ossrosch@linux.vnet.ibm.com>,
linuxppc-dev@ozlabs.org, raisch@de.ibm.com,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: idr_get_new_above() limitation?
Date: Mon, 02 Jul 2007 20:31:40 -0400 [thread overview]
Message-ID: <1183422700.3130.27.camel@localhost.localdomain> (raw)
In-Reply-To: <200707021919.27251.hnguyen@linux.vnet.ibm.com>
On Mon, 2007-07-02 at 19:19 +0200, Hoang-Nam Nguyen wrote:
> i=3fffffff token=3fffffff t=000000003fffffff
> i=40000000 token=40000000 t=0000000000000000
> Invalid object 0000000000000000. Expected 40000000
>
> That means token 0x40000000 seems to be the "upper boundary" of idr_find().
> However the behaviour is not consistent in that it was returned by
> idr_get_new_above().
Hi Nam,
Yes this is a bug. Thanks for the great test module.
The problem is in idr_get_new_above_int() in the loop which
adds new layers to the top of the radix tree. It is failing
the "layers < (MAX_LEVEL - 1)" test. It doesn't allocate the
new layer but still calls sub_alloc() which relies on having
the new layer properly constructed. I believe that it is
allocating the slot which corresponds to id = 0.
I believe this is an off by one error in calculating the
MAX_LEVEL value. I will do a more careful review and post
a fix in the next day or so. I have been in Ottawa for OLS.
I'm flying home tomorrow.
Jim Houston - Concurrent Computer Corp.
WARNING: multiple messages have this Message-ID (diff)
From: Jim Houston <jim.houston@ccur.com>
To: Hoang-Nam Nguyen <hnguyen@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org,
openib-general@openib.org,
Stefan Roscher <ossrosch@linux.vnet.ibm.com>,
raisch@de.ibm.com, Andrew Morton <akpm@linux-foundation.org>
Subject: Re: idr_get_new_above() limitation?
Date: Mon, 02 Jul 2007 20:31:40 -0400 [thread overview]
Message-ID: <1183422700.3130.27.camel@localhost.localdomain> (raw)
In-Reply-To: <200707021919.27251.hnguyen@linux.vnet.ibm.com>
On Mon, 2007-07-02 at 19:19 +0200, Hoang-Nam Nguyen wrote:
> i=3fffffff token=3fffffff t=000000003fffffff
> i=40000000 token=40000000 t=0000000000000000
> Invalid object 0000000000000000. Expected 40000000
>
> That means token 0x40000000 seems to be the "upper boundary" of idr_find().
> However the behaviour is not consistent in that it was returned by
> idr_get_new_above().
Hi Nam,
Yes this is a bug. Thanks for the great test module.
The problem is in idr_get_new_above_int() in the loop which
adds new layers to the top of the radix tree. It is failing
the "layers < (MAX_LEVEL - 1)" test. It doesn't allocate the
new layer but still calls sub_alloc() which relies on having
the new layer properly constructed. I believe that it is
allocating the slot which corresponds to id = 0.
I believe this is an off by one error in calculating the
MAX_LEVEL value. I will do a more careful review and post
a fix in the next day or so. I have been in Ottawa for OLS.
I'm flying home tomorrow.
Jim Houston - Concurrent Computer Corp.
next prev parent reply other threads:[~2007-07-03 0:44 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-02 17:19 idr_get_new_above() limitation? Hoang-Nam Nguyen
2007-07-02 17:19 ` Hoang-Nam Nguyen
2007-07-02 22:56 ` Andrew Morton
2007-07-02 22:56 ` Andrew Morton
2007-07-03 0:31 ` Jim Houston [this message]
2007-07-03 0:31 ` Jim Houston
2007-07-04 14:11 ` Hoang-Nam Nguyen
2007-07-04 14:11 ` Hoang-Nam Nguyen
2007-07-10 20:05 ` [PATCH] fix idr_get_new_above id alias bugs Jim Houston
2007-07-10 20:05 ` Jim Houston
2007-07-11 19:27 ` Hoang-Nam Nguyen
2007-07-11 19:27 ` Hoang-Nam Nguyen
2007-07-12 21:35 ` Andrew Morton
2007-07-12 21:35 ` Andrew Morton
2007-07-12 21:56 ` Chuck Ebbert
2007-07-12 21:56 ` Chuck Ebbert
2007-07-13 3:46 ` Tejun Heo
2007-07-13 3:46 ` Tejun Heo
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=1183422700.3130.27.camel@localhost.localdomain \
--to=jim.houston@ccur.com \
--cc=akpm@linux-foundation.org \
--cc=hnguyen@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=openib-general@openib.org \
--cc=ossrosch@linux.vnet.ibm.com \
--cc=raisch@de.ibm.com \
/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.