X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fradix-tree.c;h=2a087e0f98633cf00724ef0ef7b411d9f60b609e;hb=4d7b4ac22fbec1a03206c6cde353f2fd6942f828;hp=0871582aa29de45fa8ff6f372cd8e8622c3fcc46;hpb=7da23b86e14b77c094b11a9fa5ef5b3758fc9193;p=~andy%2Flinux diff --git a/lib/radix-tree.c b/lib/radix-tree.c index 0871582aa29..2a087e0f986 100644 --- a/lib/radix-tree.c +++ b/lib/radix-tree.c @@ -555,6 +555,10 @@ EXPORT_SYMBOL(radix_tree_tag_clear); * * 0: tag not present or not set * 1: tag set + * + * Note that the return value of this function may not be relied on, even if + * the RCU lock is held, unless tag modification and node deletion are excluded + * from concurrency. */ int radix_tree_tag_get(struct radix_tree_root *root, unsigned long index, unsigned int tag) @@ -595,12 +599,8 @@ int radix_tree_tag_get(struct radix_tree_root *root, */ if (!tag_get(node, tag, offset)) saw_unset_tag = 1; - if (height == 1) { - int ret = tag_get(node, tag, offset); - - BUG_ON(ret && saw_unset_tag); - return !!ret; - } + if (height == 1) + return !!tag_get(node, tag, offset); node = rcu_dereference_raw(node->slots[offset]); shift -= RADIX_TREE_MAP_SHIFT; height--;