Whamcloud - gitweb
LU-12896 gss: key can be unlinked when timeout expires 73/52473/5
authorSebastien Buisson <sbuisson@ddn.com>
Fri, 22 Sep 2023 09:20:22 +0000 (11:20 +0200)
committerOleg Drokin <green@whamcloud.com>
Mon, 16 Oct 2023 05:49:48 +0000 (05:49 +0000)
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
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52473
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Aurelien Degremont <adegremont@nvidia.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
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)