From 87b7907d39425a47f6bc7a908f0bb48b5b329bf5 Mon Sep 17 00:00:00 2001 From: Bobi Jam Date: Mon, 19 Dec 2011 09:35:27 +0800 Subject: [PATCH] LU-867 gss: adapt to 2.6.32 kernel changes cache_detail 2.6.32 kernel changes cache_detail's member cache_request to cache_upcall. Signed-off-by: Bobi Jam Change-Id: I3ddec24e88fd271c8e88e2c649be52542651b8cc Reviewed-on: http://review.whamcloud.com/1885 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Yang Sheng Reviewed-by: Oleg Drokin --- lustre/autoconf/lustre-core.m4 | 19 +++++++++++++++++++ lustre/ptlrpc/gss/gss_svc_upcall.c | 11 +++++++++++ lustre/utils/gss/context_lucid.c | 2 +- 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index bf3ba8e..10fea4d 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -1924,6 +1924,24 @@ LB_LINUX_TRY_COMPILE([ # 2.6.32 +# 2.6.32 changes cache_detail's member cache_request to cache_upcall +# in kernel commit bc74b4f5e63a09fb78e245794a0de1e5a2716bbe +AC_DEFUN([LC_CACHE_UPCALL], +[AC_MSG_CHECKING([if cache_detail has cache_upcall field]) + LB_LINUX_TRY_COMPILE([ + #include + ],[ + struct cache_detail cd; + cd.cache_upcall = NULL; + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_CACHE_UPCALL, 1, + [cache_detail has cache_upcall field]) + ],[ + AC_MSG_RESULT(no) + ]) +]) + # 2.6.32 add a limits member in struct request_queue. AC_DEFUN([LC_REQUEST_QUEUE_LIMITS], [AC_MSG_CHECKING([if request_queue has a limits field]) @@ -2410,6 +2428,7 @@ AC_DEFUN([LC_PROG_LINUX], LC_BLK_QUEUE_MAX_SECTORS LC_BLK_QUEUE_MAX_SEGMENTS LC_SET_CPUS_ALLOWED + LC_CACHE_UPCALL # 2.6.35 LC_FILE_FSYNC diff --git a/lustre/ptlrpc/gss/gss_svc_upcall.c b/lustre/ptlrpc/gss/gss_svc_upcall.c index 307f1efd..7622136 100644 --- a/lustre/ptlrpc/gss/gss_svc_upcall.c +++ b/lustre/ptlrpc/gss/gss_svc_upcall.c @@ -181,6 +181,13 @@ static void rsi_request(struct cache_detail *cd, (*bpp)[-1] = '\n'; } +#ifdef HAVE_CACHE_UPCALL +static int rsi_upcall(struct cache_detail *cd, struct cache_head *h) +{ + return sunrpc_cache_pipe_upcall(cd, h, rsi_request); +} +#endif + static inline void __rsi_init(struct rsi *new, struct rsi *item) { new->out_handle = RAWOBJ_EMPTY; @@ -472,7 +479,11 @@ static struct cache_detail rsi_cache = { .hash_table = rsi_table, .name = "auth.sptlrpc.init", .cache_put = rsi_put, +#ifdef HAVE_CACHE_UPCALL + .cache_upcall = rsi_upcall, +#else .cache_request = rsi_request, +#endif .cache_parse = rsi_parse, #ifdef HAVE_SUNRPC_CACHE_V2 .match = rsi_match, diff --git a/lustre/utils/gss/context_lucid.c b/lustre/utils/gss/context_lucid.c index c1f669f..6c5e672 100644 --- a/lustre/utils/gss/context_lucid.c +++ b/lustre/utils/gss/context_lucid.c @@ -85,7 +85,7 @@ prepare_krb5_rfc1964_buffer(gss_krb5_lucid_context_v1_t *lctx, { char *p, *end; static int constant_zero = 0; - unsigned char fakeseed[16]; + unsigned char fakeseed[16] = { 0 }; uint32_t word_send_seq; gss_krb5_lucid_key_t enc_key; int i; -- 1.8.3.1