All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hugh Dickins <hughd@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Randy Dunlap <rdunlap@xenotime.net>,
	Naveen Yadav <yad.naveen@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 1/5] rtth: fix Segmentation fault
Date: Fri, 16 Dec 2011 23:53:57 -0800 (PST)	[thread overview]
Message-ID: <alpine.LSU.2.00.1112162352210.1981@eggly.anvils> (raw)
In-Reply-To: <alpine.LSU.2.00.1112162347440.1981@eggly.anvils>

rtth radix_tree source was updated but never tested after the update??
Currently gives Segmentation fault after big_gang_check() because we
forget to remove the low bitflag from the node address in rnode:
for which we need indirect_to_ptr() not radix_tree_deref_slot().

Signed-off-by: Hugh Dickins <hughd@google.com>
---

 test.c |    2 +-
 test.h |    5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

--- rtth0/test.c	2010-11-10 16:35:29.000000000 -0800
+++ rtth1/test.c	2011-12-16 18:44:02.475897094 -0800
@@ -184,7 +184,7 @@ void verify_tag_consistency(struct radix
 {
 	if (!root->height)
 		return;
-	verify_node(radix_tree_deref_slot((void **)&root->rnode),
+	verify_node(indirect_to_ptr(root->rnode),
 			tag, root->height, !!root_tag_get(root, tag));
 }
 
--- rtth0/test.h	2010-08-25 13:30:45.000000000 -0700
+++ rtth1/test.h	2011-12-16 18:44:02.475897094 -0800
@@ -18,6 +18,11 @@ struct radix_tree_node {
         unsigned long   tags[RADIX_TREE_MAX_TAGS][RADIX_TREE_TAG_LONGS];
 };
 
+static inline void *indirect_to_ptr(void *ptr)
+{
+	return (void *)((unsigned long)ptr & ~RADIX_TREE_INDIRECT_PTR);
+}
+
 unsigned long radix_tree_maxindex(unsigned int height);
 int root_tag_get(struct radix_tree_root *root, unsigned int tag);
 /* Upto here */

  reply	other threads:[~2011-12-17  7:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-17  7:51 [PATCH 0/5] rtth: Radix Tree Test Harness fixes Hugh Dickins
2011-12-17  7:53 ` Hugh Dickins [this message]
2011-12-17  7:55 ` [PATCH 2/5] rtth: fix 32-bit build Hugh Dickins
2011-12-17  7:56 ` [PATCH 3/5] rtth: copy current radix_tree source Hugh Dickins
2011-12-17  7:57 ` [PATCH 4/5] rtth: maintain nr_allocated atomically Hugh Dickins
2011-12-17  7:59 ` [PATCH 5/5] rtth: advance to userspace-rcu-0.6.7 Hugh Dickins
2011-12-19  6:43 ` [PATCH 6/5] rtth: copy latest radix_tree source Hugh Dickins

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=alpine.LSU.2.00.1112162352210.1981@eggly.anvils \
    --to=hughd@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@xenotime.net \
    --cc=yad.naveen@gmail.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.