[RHEL7,COMMIT] lib/radix-tree: fixup for BUG_ON in __radix_tree_insert()

Submitted by Konstantin Khorenko on Dec. 27, 2019, 12:04 p.m.

Details

Message ID 201912271204.xBRC4phZ007442@finist-ce7.sw.ru
State New
Series "lib/radix-tree: fixup for BUG_ON in __radix_tree_insert()"
Headers show

Commit Message

Konstantin Khorenko Dec. 27, 2019, 12:04 p.m.
The commit is pushed to "branch-rh7-3.10.0-1062.7.1.vz7.130.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1062.7.1.vz7.130.6
------>
commit 5ddc0f15746712d643895dd4756e330f4a26ffeb
Author: Vasily Averin <vvs@virtuozzo.com>
Date:   Fri Dec 27 15:04:51 2019 +0300

    lib/radix-tree: fixup for BUG_ON in __radix_tree_insert()
    
    __radix_tree_insert() triggers BUG_ON if root have set any prev tag
    bits. Let's ignore prev tag bits.
    
    Fixes: c68ade41961d4 ("radix-tree: save previous gfp_t tags in radix tree
    for dirty memory accounting")
    
    https://jira.sw.ru/browse/PSBM-100579
    Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
---
 lib/radix-tree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/lib/radix-tree.c b/lib/radix-tree.c
index 3a8dc9a84f032..eaad271034c24 100644
--- a/lib/radix-tree.c
+++ b/lib/radix-tree.c
@@ -167,7 +167,7 @@  static inline int root_tag_get(struct radix_tree_root *root, unsigned int tag)
 
 static inline unsigned root_tags_get(struct radix_tree_root *root)
 {
-	return (__force unsigned)root->gfp_mask >> __GFP_BITS_SHIFT;
+	return (__force unsigned)(root->gfp_mask & RADIX_ROOT_TAG_MASK) >> __GFP_BITS_SHIFT;
 }
 
 static inline void prev_tag_set(struct radix_tree_root *root, unsigned int tag)