From: Mikhail Pershin Date: Fri, 8 Nov 2019 06:26:06 +0000 (+0300) Subject: LU-12741 ptlrpc: do lu_env_refill for new request X-Git-Tag: 2.13.51~108 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=3f304b75d24aea0075415affa0c0bef004ef012c LU-12741 ptlrpc: do lu_env_refill for new request Perform lu_env_refill() prior any new request handling. That was done already in tgt_request_handle() and is moved now to ptlrpc_main() to work for any handler as well, e.g. ldlm_cancel_handler() Signed-off-by: Mikhail Pershin Change-Id: Ic5d8bfbd845f7e131849078c016f7e13b91d072f Reviewed-on: https://review.whamcloud.com/36714 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Alex Zhuravlev Reviewed-by: Lai Siyao Reviewed-by: Oleg Drokin --- diff --git a/lustre/ptlrpc/service.c b/lustre/ptlrpc/service.c index bb2a274..e68643c 100644 --- a/lustre/ptlrpc/service.c +++ b/lustre/ptlrpc/service.c @@ -2849,6 +2849,9 @@ static int ptlrpc_main(void *arg) /* reset le_ses to initial state */ env->le_ses = NULL; + /* Refill the context before execution to make sure + * all thread keys are allocated */ + lu_env_refill(env); /* Process all incoming reqs before handling any */ if (ptlrpc_server_request_incoming(svcpt)) { lu_context_enter(&env->le_ctx); diff --git a/lustre/target/tgt_handler.c b/lustre/target/tgt_handler.c index 76ebeac..4a6443e 100644 --- a/lustre/target/tgt_handler.c +++ b/lustre/target/tgt_handler.c @@ -720,9 +720,6 @@ int tgt_request_handle(struct ptlrpc_request *req) } } - /* Refill the context, to make sure all thread keys are allocated */ - lu_env_refill(req->rq_svc_thread->t_env); - req_capsule_init(&req->rq_pill, req, RCL_SERVER); tsi->tsi_pill = &req->rq_pill; tsi->tsi_env = req->rq_svc_thread->t_env;