[Devel] fs: Prevent massive warn spamming

Submitted by Dmitry Monakhov on March 20, 2017, 9:52 a.m.

Details

Message ID 1490003521-6462-1-git-send-email-dmonakhov@openvz.org
State New
Series "fs: Prevent massive warn spamming"
Headers show

Commit Message

Dmitry Monakhov March 20, 2017, 9:52 a.m.
Even if detection spots potential bug, is it not good to bloat kmsg.
WARN_ON_ONCE is enought to detect exact calltrace.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
 mm/page_alloc.c | 2 +-
 mm/slab.c       | 4 ++--
 mm/slub.c       | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index b799171..d6a04f5 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3150,7 +3150,7 @@  __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order,
 	lockdep_trace_alloc(gfp_mask);
 
 	might_sleep_if(gfp_mask & __GFP_WAIT);
-	WARN_ON((gfp_mask & __GFP_FS) && current->journal_info);
+	WARN_ON_ONCE((gfp_mask & __GFP_FS) && current->journal_info);
 
 	if (should_fail_alloc_page(gfp_mask, order))
 		return NULL;
diff --git a/mm/slab.c b/mm/slab.c
index f0e4b79..4f0c22e 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3343,7 +3343,7 @@  slab_alloc_node(struct kmem_cache *cachep, gfp_t flags, int nodeid,
 	flags &= gfp_allowed_mask;
 
 	lockdep_trace_alloc(flags);
-	WARN_ON((flags & __GFP_FS) && current->journal_info);
+	WARN_ON_ONCE((flags & __GFP_FS) && current->journal_info);
 
 	if (slab_should_failslab(cachep, flags))
 		return NULL;
@@ -3433,7 +3433,7 @@  slab_alloc(struct kmem_cache *cachep, gfp_t flags, unsigned long caller)
 	flags &= gfp_allowed_mask;
 
 	lockdep_trace_alloc(flags);
-	WARN_ON((flags & __GFP_FS) && current->journal_info);
+	WARN_ON_ONCE((flags & __GFP_FS) && current->journal_info);
 
 	if (slab_should_failslab(cachep, flags))
 		return NULL;
diff --git a/mm/slub.c b/mm/slub.c
index fcebd14..280adf6 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1266,7 +1266,7 @@  static inline int slab_pre_alloc_hook(struct kmem_cache *s, gfp_t flags)
 	flags &= gfp_allowed_mask;
 	lockdep_trace_alloc(flags);
 	might_sleep_if(flags & __GFP_WAIT);
-	WARN_ON((flags & __GFP_FS) && current->journal_info);
+	WARN_ON_ONCE((flags & __GFP_FS) && current->journal_info);
 
 	return should_failslab(s->object_size, flags, s->flags);
 }