Skip to contentSkip to conversation

mm/rmap: replace BUG_ON(anon_vma->degree) with VM_WARN_ON

PATCH In review Konstantin Khlebnikov 2 participants 2 messages Mar 31, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm/rmap: replace BUG_ON(anon_vma->degree) with VM_WARN_ON

This check effectively catches anon vma hierarchy inconsistence and some vma corruptions. It was effective for catching corner cases in anon vma reusing logic. For now this code seems stable so check could be hidden under CONFIG_DEBUG_VM and replaced with WARN because it's not so fatal.

---
 mm/rmap.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/rmap.c +1 -1
index 395e314b7996..a8d52d3f40ed 100644
@@ -409,7 +409,7 @@ void unlink_anon_vmas(struct vm_area_struct *vma)
 	list_for_each_entry_safe(avc, next, &vma->anon_vma_chain, same_vma) {
 		struct anon_vma *anon_vma = avc->anon_vma;
 
-		BUG_ON(anon_vma->degree);
+		VM_WARN_ON(anon_vma->degree);
 		put_anon_vma(anon_vma);
 
 		list_del(&avc->same_vma);

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Konstantin Khlebnikov

This check effectively catches anon vma hierarchy inconsistence and some vma corruptions. It was effective for catching corner cases in anon vma reusing logic. For now this code seems stable so check could be hidden under CONFIG_DEBUG_VM and replaced with WARN because it's not so fatal.

Quoted 24 lines
---
  mm/rmap.c |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
mm/rmap.c +1 -2
index 395e314b7996..a8d52d3f40ed 100644
@@ -409,7 +409,7 @@ void unlink_anon_vmas(struct vm_area_struct *vma)
  	list_for_each_entry_safe(avc, next, &vma->anon_vma_chain, same_vma) {
  		struct anon_vma *anon_vma = avc->anon_vma;
 
-		BUG_ON(anon_vma->degree);
+		VM_WARN_ON(anon_vma->degree);
  		put_anon_vma(anon_vma);
 
  		list_del(&avc->same_vma);
 
--

To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>