From: Andrew Morton <akpm@osdl.org>
To: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: corbet@lwn.net, linux-kernel@vger.kernel.org
Subject: Re: RFC: radix tree safety
Date: Mon, 13 Mar 2006 15:50:58 -0800 [thread overview]
Message-ID: <20060313155058.1389ee9a.akpm@osdl.org> (raw)
In-Reply-To: <4415F87E.806@yahoo.com.au>
Nick Piggin <nickpiggin@yahoo.com.au> wrote:
>
> Jonathan Corbet wrote:
>
> >I've been digging through the radix tree code, and I noticed that the
> >tag functions have an interesting limitation. The tag is given as an
> >integer value, but, in reality, the only values that work are zero and
> >one. Anything else will return random results or (when setting tags)
> >corrupt unrelated memory.
Various people at various times have added additional tags. reiser4...
> >The number of radix tree users is small, so it's not hard to confirm
> >that all tag values currently in use are legal. But the interface would
> >seem to invite mistakes.
> >
> >The following patch puts in checks for out-of-range tag values. I've
> >elected to have the relevant call fail; one could argue that it should
> >BUG instead. Either seems better than silently doing weird stuff. Not
> >2.6.16 material, obviously, but maybe suitable thereafter.
> >
> >
>
> I'd agree if you make them BUG_ON()s.
>
> Andrew Morton's kind of the radix-tree tags guy though... Andrew?
I don't really see the need - if someone goes and overindexes the data
structure's capacity then they have a bug and hopefully that'll turn up in
testing and will get fixed.
Or am I missing something obvious which makes radix-trees particularly
dangerous or subtle??
next prev parent reply other threads:[~2006-03-13 23:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-13 22:43 Jonathan Corbet
2006-03-13 22:55 ` Nick Piggin
2006-03-13 23:50 ` Andrew Morton [this message]
2006-03-14 0:01 ` Jonathan Corbet
2006-03-14 0:14 ` Andrew Morton
2006-03-14 5:24 ` Nick Piggin
2006-03-16 17:13 ` Jonathan Corbet
2006-03-17 0:41 ` Nick Piggin
2006-03-13 23:03 ` Randy.Dunlap
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=20060313155058.1389ee9a.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=corbet@lwn.net \
--cc=linux-kernel@vger.kernel.org \
--cc=nickpiggin@yahoo.com.au \
/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
Powered by JetHome