From 09e5f8ad23a880cb12fdf521b46a30e1f0a11d03 Mon Sep 17 00:00:00 2001 From: Sebastien Buisson Date: Thu, 23 Jul 2015 13:37:37 +0200 Subject: [PATCH] LU-6356 ptlrpc: do not switch out-of-date context When trying to replace a dead sec context with a new one, we must ensure the new context is already up-to-date. If it is not the case, just return from sptlrpc_req_replace_dead_ctx() and come later when the new context has been updated. Signed-off-by: Sebastien Buisson Change-Id: I3b0862f838b917b568e08d46a24581a39c9459c1 Reviewed-on: http://review.whamcloud.com/15708 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Mike Pershin Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin --- lustre/ptlrpc/sec.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lustre/ptlrpc/sec.c b/lustre/ptlrpc/sec.c index ccb6d82..254aed5 100644 --- a/lustre/ptlrpc/sec.c +++ b/lustre/ptlrpc/sec.c @@ -581,6 +581,14 @@ int sptlrpc_req_replace_dead_ctx(struct ptlrpc_request *req) set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(msecs_to_jiffies(MSEC_PER_SEC)); + } else if (unlikely(test_bit(PTLRPC_CTX_UPTODATE_BIT, &newctx->cc_flags) + == 0)) { + /* + * new ctx not up to date yet + */ + CDEBUG(D_SEC, + "ctx (%p, fl %lx) doesn't switch, not up to date yet\n", + newctx, newctx->cc_flags); } else { /* * it's possible newctx == oldctx if we're switching -- 1.8.3.1