diff --git a/lustre/ptlrpc/import.c b/lustre/ptlrpc/import.c index fc2c87b8e02e2d3ffdb27ede5c4d4aca33f0de6c..69f3d7b81cbeffe9f67dcbc7807daf67b462a0d7 100644 --- a/lustre/ptlrpc/import.c +++ b/lustre/ptlrpc/import.c @@ -655,7 +655,14 @@ static int ptlrpc_connect_interpret(struct ptlrpc_request *request, *lustre_msg_get_handle(request->rq_repmsg); IMPORT_SET_STATE(imp, LUSTRE_IMP_FULL); - ptlrpc_activate_import(imp); + spin_lock(&imp->imp_lock); + if (imp->imp_invalid) { + spin_unlock(&imp->imp_lock); + ptlrpc_activate_import(imp); + } else { + spin_unlock(&imp->imp_lock); + } + GOTO(finish, rc = 0); } else { spin_unlock(&imp->imp_lock);