]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
radix_tree_tag_get()'s BUG (when it sees a tag after saw_unset_tag) was
authorHugh Dickins <hughd@google.com>
Wed, 24 Aug 2011 23:46:48 +0000 (09:46 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 12 Sep 2011 05:27:16 +0000 (15:27 +1000)
unsafe and removed in 2.6.34, but the pointless saw_unset_tag left behind.

Remove it now, and return 0 as soon as we see unset tag - we already rely
upon the root tag to be correct, returning 0 immediately if it's not set.

Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/radix-tree.c

index a2f9da59c1970cfab2a55c94f43da8843551ef05..d9df7454519cd546c71aa10adf14204bee86ef7f 100644 (file)
@@ -576,7 +576,6 @@ int radix_tree_tag_get(struct radix_tree_root *root,
 {
        unsigned int height, shift;
        struct radix_tree_node *node;
-       int saw_unset_tag = 0;
 
        /* check the root's tag bit */
        if (!root_tag_get(root, tag))
@@ -603,15 +602,10 @@ int radix_tree_tag_get(struct radix_tree_root *root,
                        return 0;
 
                offset = (index >> shift) & RADIX_TREE_MAP_MASK;
-
-               /*
-                * This is just a debug check.  Later, we can bale as soon as
-                * we see an unset tag.
-                */
                if (!tag_get(node, tag, offset))
-                       saw_unset_tag = 1;
+                       return 0;
                if (height == 1)
-                       return !!tag_get(node, tag, offset);
+                       return 1;
                node = rcu_dereference_raw(node->slots[offset]);
                shift -= RADIX_TREE_MAP_SHIFT;
                height--;