diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2014-12-11 00:42:25 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-11 02:41:04 +0100 |
commit | c871ac4e9666ad68ae861172ef8a7f73d6e61b26 (patch) | |
tree | 4ca2000cf5e0c663f1b70efadf38127fa7b59b7c /mm/slub.c | |
parent | mm: slub: fix format mismatches in slab_err() callers (diff) | |
download | linux-c871ac4e9666ad68ae861172ef8a7f73d6e61b26.tar.xz linux-c871ac4e9666ad68ae861172ef8a7f73d6e61b26.zip |
slab: improve checking for invalid gfp_flags
The code goes BUG, but doesn't tell us which bits were unexpectedly set.
Print that out.
Cc: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/slub.c')
-rw-r--r-- | mm/slub.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/slub.c b/mm/slub.c index cf4f3c480b98..386bbed76e94 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1377,7 +1377,10 @@ static struct page *new_slab(struct kmem_cache *s, gfp_t flags, int node) int order; int idx; - BUG_ON(flags & GFP_SLAB_BUG_MASK); + if (unlikely(flags & GFP_SLAB_BUG_MASK)) { + pr_emerg("gfp: %u\n", flags & GFP_SLAB_BUG_MASK); + BUG(); + } page = allocate_slab(s, flags & (GFP_RECLAIM_MASK | GFP_CONSTRAINT_MASK), node); |