From 62a879ede4b51440913d3ff275db4af317d49dd4 Mon Sep 17 00:00:00 2001
From: kalpak <kalpak>
Date: Tue, 13 Nov 2007 14:51:36 +0000
Subject: [PATCH] b=13858 i=fanyong

key may not be NULL terminated on HEAD, so change KEY_IS() macro to use strncmp() instead of strcmp.
---
 lustre/include/obd_support.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lustre/include/obd_support.h b/lustre/include/obd_support.h
index a8831294d3..469ded98ea 100644
--- a/lustre/include/obd_support.h
+++ b/lustre/include/obd_support.h
@@ -715,7 +715,7 @@ do {                                                                          \
 #define OBD_SLAB_FREE_PTR(ptr, slab)                                          \
         OBD_SLAB_FREE((ptr), (slab), sizeof *(ptr))
 
-#define KEY_IS(str) (keylen >= strlen(str) && strcmp(key, str) == 0)
+#define KEY_IS(str) (keylen >= strlen(str) && strncmp(key, str, keylen) == 0)
 
 /* Wrapper for contiguous page frame allocation */
 #define OBD_PAGES_ALLOC(ptr, order, gfp_mask)                                 \
-- 
GitLab