From: Sebastien Buisson Date: Fri, 22 Sep 2023 09:20:22 +0000 (+0200) Subject: LU-12896 gss: key can be unlinked when timeout expires X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=d6f6182387850b93c9266ccc7888576f93950d43;p=fs%2Flustre-release.git LU-12896 gss: key can be unlinked when timeout expires 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 Change-Id: I714af3a1ce54648c4ba29ef13015f9291de52765 --- diff --git a/lustre/ptlrpc/gss/gss_keyring.c b/lustre/ptlrpc/gss/gss_keyring.c index a1c67d49..5dfb73f 100644 --- a/lustre/ptlrpc/gss/gss_keyring.c +++ b/lustre/ptlrpc/gss/gss_keyring.c @@ -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)