[lustre-devel] [PATCH 542/622] lustre: ptlrpc: do lu_env_refill for any new request

James Simmons jsimmons at infradead.org
Thu Feb 27 13:16:50 PST 2020


From: Mikhail Pershin <mpershin at whamcloud.com>

Perform lu_env_refill() prior any new request handling. That was
done already server side by tgt_request_handle() and is moved now
to ptlrpc_main() to work for any handler as well,
e.g. ldlm_cancel_handler()

WC-bug-id: https://jira.whamcloud.com/browse/LU-12741
Lustre-commit: 3f304b75d24a ("LU-12741 ptlrpc: do lu_env_refill for new request")
Signed-off-by: Mikhail Pershin <mpershin at whamcloud.com>
Reviewed-on: https://review.whamcloud.com/36714
Reviewed-by: Alex Zhuravlev <bzzz at whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao at whamcloud.com>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 fs/lustre/ptlrpc/service.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fs/lustre/ptlrpc/service.c b/fs/lustre/ptlrpc/service.c
index c874487..f65d5c5 100644
--- a/fs/lustre/ptlrpc/service.c
+++ b/fs/lustre/ptlrpc/service.c
@@ -2281,6 +2281,12 @@ static int ptlrpc_main(void *arg)
 			ptlrpc_start_thread(svcpt, 0);
 		}
 
+		/* 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);
-- 
1.8.3.1



More information about the lustre-devel mailing list