Whamcloud - gitweb
LU-7636 gss: avoid useless sec debug log flooding 69/17869/2
authorSebastien Buisson <sbuisson@ddn.com>
Thu, 7 Jan 2016 10:39:19 +0000 (11:39 +0100)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 12 Jan 2016 02:45:42 +0000 (02:45 +0000)
Avoid useless sec debug log flooding by printing gss context deletion
messages only when context is not null.

Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: I9a93813c52c6edadac435e5ba53ed292b81d6566
Reviewed-on: http://review.whamcloud.com/17869
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/ptlrpc/gss/gss_mech_switch.c

index ed0f251..a82298a 100644 (file)
@@ -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,