aboutsummaryrefslogtreecommitdiffstats
path: root/lib/radix-tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/radix-tree.c')
-rw-r--r--lib/radix-tree.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/radix-tree.c b/lib/radix-tree.c
index c0bd4a914803..1e5b17dc7e3d 100644
--- a/lib/radix-tree.c
+++ b/lib/radix-tree.c
@@ -752,12 +752,14 @@ void *radix_tree_delete(struct radix_tree_root *root, unsigned long index)
752 */ 752 */
753 nr_cleared_tags = 0; 753 nr_cleared_tags = 0;
754 for (tag = 0; tag < RADIX_TREE_TAGS; tag++) { 754 for (tag = 0; tag < RADIX_TREE_TAGS; tag++) {
755 tags[tag] = 1;
755 if (tag_get(pathp->node, tag, pathp->offset)) { 756 if (tag_get(pathp->node, tag, pathp->offset)) {
756 tag_clear(pathp->node, tag, pathp->offset); 757 tag_clear(pathp->node, tag, pathp->offset);
757 tags[tag] = 0; 758 if (!any_tag_set(pathp->node, tag)) {
758 nr_cleared_tags++; 759 tags[tag] = 0;
759 } else 760 nr_cleared_tags++;
760 tags[tag] = 1; 761 }
762 }
761 } 763 }
762 764
763 for (pathp--; nr_cleared_tags && pathp->node; pathp--) { 765 for (pathp--; nr_cleared_tags && pathp->node; pathp--) {