From 7c2eabb01f028d3d17200c532177aa06435ef3d1 Mon Sep 17 00:00:00 2001 From: Chris Horn Date: Mon, 29 Jun 2015 13:54:34 -0500 Subject: [PATCH 1/1] LU-6261 gnilnd: Fix LIBCFS_ALLOC_POST incompatibility. master has changed LIBCFS_ALLOC to use vzalloc so LIBCFS_ALLOC_POST does not contain a memset anymore. kgnilnd_vmalloc() used LIBCFS_ALLOC_POST to zero memory allocated but master removed the memset in favor of using vzalloc. Use the __GFP_ZERO flag in (now named) kgnilnd_vzalloc to zero memory allocated. Signed-off-by: Chris Horn Change-Id: Ia014c18f13e4e263eccb51d49d375fc4b3bc8b61 Reviewed-on: http://review.whamcloud.com/15435 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: James Shimek Reviewed-by: Doug Oucharek Reviewed-by: Oleg Drokin --- lnet/klnds/gnilnd/gnilnd.c | 2 +- lnet/klnds/gnilnd/gnilnd.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lnet/klnds/gnilnd/gnilnd.c b/lnet/klnds/gnilnd/gnilnd.c index d29749e..285c5b0 100644 --- a/lnet/klnds/gnilnd/gnilnd.c +++ b/lnet/klnds/gnilnd/gnilnd.c @@ -249,7 +249,7 @@ kgnilnd_create_conn(kgn_conn_t **connp, kgn_device_t *dev) } conn->gnc_tx_ref_table = - kgnilnd_vmalloc(GNILND_MAX_MSG_ID * sizeof(void *)); + kgnilnd_vzalloc(GNILND_MAX_MSG_ID * sizeof(void *)); if (conn->gnc_tx_ref_table == NULL) { CERROR("Can't allocate conn tx_ref_table\n"); GOTO(failed, rc = -ENOMEM); diff --git a/lnet/klnds/gnilnd/gnilnd.h b/lnet/klnds/gnilnd/gnilnd.h index 2b9c039..b75d850 100644 --- a/lnet/klnds/gnilnd/gnilnd.h +++ b/lnet/klnds/gnilnd/gnilnd.h @@ -964,9 +964,10 @@ static inline int kgnilnd_trylock(struct mutex *cq_lock, return __kgnilnd_mutex_trylock(c_lock); } -static inline void *kgnilnd_vmalloc(int size) +static inline void *kgnilnd_vzalloc(int size) { - void *ret = __vmalloc(size, __GFP_HIGHMEM | GFP_NOFS, PAGE_KERNEL); + void *ret = __vmalloc(size, __GFP_HIGHMEM | GFP_NOFS | __GFP_ZERO, + PAGE_KERNEL); LIBCFS_ALLOC_POST(ret, size); return ret; } -- 1.8.3.1