From ef1c7a069131512458be75aae1e4857fcd8f133b Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 23 Dec 2009 12:57:10 -0800 Subject: [PATCH] Strip __GFP_ZERO from kmalloc it is not available for older kernels. This is needed to avoid a BUG_ON() on RHEL5.4 kernel 2.6.18-164.6.1, since __GFP_ZERO is not a valid flag for kmalloc(). --- module/spl/spl-kmem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/spl/spl-kmem.c b/module/spl/spl-kmem.c index 64498ee..f87d2b5 100644 --- a/module/spl/spl-kmem.c +++ b/module/spl/spl-kmem.c @@ -505,7 +505,8 @@ vmem_alloc_track(size_t size, int flags, const char *func, int line) ASSERT(flags & KM_SLEEP); - dptr = (kmem_debug_t *) kmalloc_nofail(sizeof(kmem_debug_t), flags); + dptr = (kmem_debug_t *) kmalloc_nofail(sizeof(kmem_debug_t), + flags & ~__GFP_ZERO); if (dptr == NULL) { CWARN("vmem_alloc(%ld, 0x%x) debug failed\n", sizeof(kmem_debug_t), flags); -- 2.40.0