]> git.baikalelectronics.ru Git - kernel.git/commit
radix-tree: clear all tags in radix_tree_node_rcu_free
authorDave Chinner <dchinner@redhat.com>
Mon, 23 Aug 2010 00:33:19 +0000 (10:33 +1000)
committerDave Chinner <david@fromorbit.com>
Mon, 23 Aug 2010 00:33:19 +0000 (10:33 +1000)
commitba5c74ff2d2653dbf456791be21b179e7a66ef81
treefa70f295a5074627a6b6dba11a8c8cf90d4e4b95
parentd1a5ef25f4f4034bef7991998f8f95568eb6224a
radix-tree: clear all tags in radix_tree_node_rcu_free

Commit b5d84a7834f8374c1feb0b86e070f9559ee37190 ("mm: implement
writeback livelock avoidance using page tagging") introduced a new
radix tree tag, increasing the number of tags in each node from 2 to
3. It did not, however, fix up the code in
radix_tree_node_rcu_free() that cleans up after radix_tree_shrink()
and hence could leave stray tags set in the new tag array.

The result is that the livelock avoidance code added in the the
above commit would hit stale tags when doing tag based lookups,
resulting in livelocks when trying to traverse the tree.

Fix this problem in radix_tree_node_rcu_free() so it doesn't happen
again in the future by using a loop to walk all the tags up to
RADIX_TREE_MAX_TAGS to clear the stray tags radix_tree_shrink()
leaves behind.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Acked-by: Nick Piggin <npiggin@kernel.dk>
Acked-by: Jan Kara <jack@suse.cz>
lib/radix-tree.c