]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Merge branch 'radix-tree' of git://git.kernel.org/pub/scm/linux/kernel/git/dgc/xfsdev
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 23 Aug 2010 02:55:14 +0000 (19:55 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 23 Aug 2010 02:55:14 +0000 (19:55 -0700)
* 'radix-tree' of git://git.kernel.org/pub/scm/linux/kernel/git/dgc/xfsdev:
  radix-tree: radix_tree_range_tag_if_tagged() can set incorrect tags
  radix-tree: clear all tags in radix_tree_node_rcu_free

1  2 
lib/radix-tree.c

index 5b7d4623f0b70aee189deda3bc8318a590476160,e0ee8cb37e41b5b4c173f7f83997ce43c69038ac..efd16fa80b1cfd55f2e1f1295f1cd45765925abf
@@@ -623,10 -625,15 +625,17 @@@ EXPORT_SYMBOL(radix_tree_tag_get)
   * also settag. The function stops either after tagging nr_to_tag items or
   * after reaching last_index.
   *
+  * The tags must be set from the leaf level only and propagated back up the
+  * path to the root. We must do this so that we resolve the full path before
+  * setting any tags on intermediate nodes. If we set tags as we descend, then
+  * we can get to the leaf node and find that the index that has the iftag
+  * set is outside the range we are scanning. This reults in dangling tags and
+  * can lead to problems with later tag operations (e.g. livelocks on lookups).
+  *
   * The function returns number of leaves where the tag was set and sets
   * *first_indexp to the first unscanned index.
 + * WARNING! *first_indexp can wrap if last_index is ULONG_MAX. Caller must
 + * be prepared to handle that.
   */
  unsigned long radix_tree_range_tag_if_tagged(struct radix_tree_root *root,
                unsigned long *first_indexp, unsigned long last_index,