lkml.org 
[lkml]   [2011]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 1/5] rtth: fix Segmentation fault
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 */

\
 
 \ /
  Last update: 2011-12-17 08:57    [W:0.035 / U:0.800 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site