mm: workingset: fix crash in shadow node shrinker caused by replace_page_cache_page()
[firefly-linux-kernel-4.4.55.git] / include / linux / swap.h
index 7ba7dccaf0e7e1291b3489c9ece30318cb44fc6f..b28de19aadbfdf57cc9a5326a290df0da8c3b369 100644 (file)
@@ -266,6 +266,7 @@ static inline void workingset_node_pages_inc(struct radix_tree_node *node)
 
 static inline void workingset_node_pages_dec(struct radix_tree_node *node)
 {
+       VM_BUG_ON(!workingset_node_pages(node));
        node->count--;
 }
 
@@ -281,6 +282,7 @@ static inline void workingset_node_shadows_inc(struct radix_tree_node *node)
 
 static inline void workingset_node_shadows_dec(struct radix_tree_node *node)
 {
+       VM_BUG_ON(!workingset_node_shadows(node));
        node->count -= 1U << RADIX_TREE_COUNT_SHIFT;
 }