Whamcloud - gitweb
LU-12896 gss: key can be unlinked when timeout expires 73/52473/4
authorSebastien Buisson <sbuisson@ddn.com>
Fri, 22 Sep 2023 09:20:22 +0000 (11:20 +0200)
committerSebastien Buisson <sbuisson@ddn.com>
Thu, 28 Sep 2023 07:38:51 +0000 (09:38 +0200)
The key associated with a GSS context could appear to be already
unlinked when the upcall timeout expires. In this case, do not assert
but report this case with a warning message.

Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: I714af3a1ce54648c4ba29ef13015f9291de52765

lustre/ptlrpc/gss/gss_keyring.c

index a1c67d4..5dfb73f 100644 (file)
@@ -113,14 +113,21 @@ static void ctx_upcall_timeout_kr(cfs_timer_cb_arg_t data)
        struct gss_cli_ctx_keyring *gctx_kr = cfs_from_timer(gctx_kr,
                                                             data, gck_timer);
        struct ptlrpc_cli_ctx *ctx = &(gctx_kr->gck_base.gc_base);
+       struct obd_import *imp = ctx->cc_sec->ps_import;
        struct key *key = gctx_kr->gck_key;
 
-        CWARN("ctx %p, key %p\n", ctx, key);
-
-        LASSERT(key);
+       if (key)
+               CDEBUG(D_SEC,
+                      "%s: GSS context (%p) negotiation timeout, revoking key (%p)\n",
+                      imp->imp_obd->obd_name, ctx, key);
+       else
+               CDEBUG(D_SEC,
+                      "%s: GSS context (%p) negotiation timeout, ignoring already unlinked key\n",
+                      imp->imp_obd->obd_name, ctx);
 
-        cli_ctx_expire(ctx);
-        key_revoke_locked(key);
+       cli_ctx_expire(ctx);
+       if (key)
+               key_revoke_locked(key);
 }
 
 static void ctx_start_timer_kr(struct ptlrpc_cli_ctx *ctx, time64_t timeout)