From de916605a4a6fbff8474fa693141c66efe76cc5d Mon Sep 17 00:00:00 2001 From: Sebastien Buisson Date: Thu, 7 Jan 2016 11:39:19 +0100 Subject: [PATCH] LU-7636 gss: avoid useless sec debug log flooding Avoid useless sec debug log flooding by printing gss context deletion messages only when context is not null. Signed-off-by: Sebastien Buisson Change-Id: I9a93813c52c6edadac435e5ba53ed292b81d6566 Reviewed-on: http://review.whamcloud.com/17869 Tested-by: Jenkins Reviewed-by: Andreas Dilger Reviewed-by: John L. Hammond Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/ptlrpc/gss/gss_mech_switch.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/lustre/ptlrpc/gss/gss_mech_switch.c b/lustre/ptlrpc/gss/gss_mech_switch.c index ed0f251..a82298a 100644 --- a/lustre/ptlrpc/gss/gss_mech_switch.c +++ b/lustre/ptlrpc/gss/gss_mech_switch.c @@ -323,27 +323,27 @@ __u32 lgss_unwrap_bulk(struct gss_ctx *context_handle, __u32 lgss_delete_sec_context(struct gss_ctx **context_handle) { - struct gss_api_mech *mech; + struct gss_api_mech *mech; - CDEBUG(D_SEC, "deleting %p\n", *context_handle); + if (!*context_handle) + return GSS_S_NO_CONTEXT; - if (!*context_handle) - return(GSS_S_NO_CONTEXT); + CDEBUG(D_SEC, "deleting %p\n", *context_handle); - mech = (*context_handle)->mech_type; + mech = (*context_handle)->mech_type; if ((*context_handle)->internal_ctx_id != NULL) { - LASSERT(mech); - LASSERT(mech->gm_ops); - LASSERT(mech->gm_ops->gss_delete_sec_context); - mech->gm_ops->gss_delete_sec_context( - (*context_handle)->internal_ctx_id); - } - if (mech) - lgss_mech_put(mech); + LASSERT(mech); + LASSERT(mech->gm_ops); + LASSERT(mech->gm_ops->gss_delete_sec_context); + mech->gm_ops->gss_delete_sec_context( + (*context_handle)->internal_ctx_id); + } + if (mech) + lgss_mech_put(mech); - OBD_FREE_PTR(*context_handle); - *context_handle=NULL; - return GSS_S_COMPLETE; + OBD_FREE_PTR(*context_handle); + *context_handle = NULL; + return GSS_S_COMPLETE; } int lgss_display(struct gss_ctx *ctx, -- 1.8.3.1