From b33e22c4b4c6411af51805da21b741367c72ec71 Mon Sep 17 00:00:00 2001 From: Sebastien Buisson Date: Fri, 28 Aug 2015 11:19:00 +0200 Subject: [PATCH] LU-6356 tgt: add handlers for SEC_CTX_* requests When dealing with security context refresh requests, an export is already associated with the request. So the normal *_common_slice handlers are called. We then have to have handlers for SEC_CTX_INIT, SEC_CTX_INIT_CONT and SEC_CTX_FINI requests in *_common_slice for all target types. This patch reintroduces the handlers that were removed by patch http://review.whamcloud.com/14041, plus adds a new one for ofd. Signed-off-by: Sebastien Buisson Change-Id: Ifadaff9d7f07cf4c6a75cd1f5054378aaca27c26 Reviewed-on: http://review.whamcloud.com/16124 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Dmitry Eremin Reviewed-by: Andrew Perepechko Reviewed-by: John L. Hammond Reviewed-by: Mike Pershin Reviewed-by: Oleg Drokin --- lustre/include/lu_target.h | 1 + lustre/mgs/mgs_handler.c | 5 +++++ lustre/ofd/ofd_dev.c | 5 +++++ lustre/target/tgt_handler.c | 16 ++++++++++++++++ 4 files changed, 27 insertions(+) diff --git a/lustre/include/lu_target.h b/lustre/include/lu_target.h index 7189ba7..9b62156 100644 --- a/lustre/include/lu_target.h +++ b/lustre/include/lu_target.h @@ -400,6 +400,7 @@ void tgt_register_lfsck_query(int (*query)(const struct lu_env *, struct lfsck_request *)); bool req_can_reconstruct(struct ptlrpc_request *req, struct tg_reply_data *trd); +extern struct tgt_handler tgt_sec_ctx_handlers[]; extern struct tgt_handler tgt_lfsck_handlers[]; extern struct tgt_handler tgt_obd_handlers[]; extern struct tgt_handler tgt_dlm_handlers[]; diff --git a/lustre/mgs/mgs_handler.c b/lustre/mgs/mgs_handler.c index c2041ce..8c2c8ea 100644 --- a/lustre/mgs/mgs_handler.c +++ b/lustre/mgs/mgs_handler.c @@ -1072,6 +1072,11 @@ static struct tgt_opc_slice mgs_common_slice[] = { .tos_hs = mgs_llog_handlers }, { + .tos_opc_start = SEC_FIRST_OPC, + .tos_opc_end = SEC_LAST_OPC, + .tos_hs = tgt_sec_ctx_handlers + }, + { .tos_hs = NULL } }; diff --git a/lustre/ofd/ofd_dev.c b/lustre/ofd/ofd_dev.c index e4ddf91..a55a234 100644 --- a/lustre/ofd/ofd_dev.c +++ b/lustre/ofd/ofd_dev.c @@ -2646,6 +2646,11 @@ static struct tgt_opc_slice ofd_common_slice[] = { .tos_hs = tgt_lfsck_handlers }, { + .tos_opc_start = SEC_FIRST_OPC, + .tos_opc_end = SEC_LAST_OPC, + .tos_hs = tgt_sec_ctx_handlers + }, + { .tos_hs = NULL } }; diff --git a/lustre/target/tgt_handler.c b/lustre/target/tgt_handler.c index 53a7867..1110902 100644 --- a/lustre/target/tgt_handler.c +++ b/lustre/target/tgt_handler.c @@ -1451,6 +1451,22 @@ TGT_LLOG_HDL_VAR(0, LLOG_ORIGIN_HANDLE_CLOSE, tgt_llog_close), }; EXPORT_SYMBOL(tgt_llog_handlers); +/* + * sec context handlers + */ +/* XXX: Implement based on mdt_sec_ctx_handle()? */ +static int tgt_sec_ctx_handle(struct tgt_session_info *tsi) +{ + return 0; +} + +struct tgt_handler tgt_sec_ctx_handlers[] = { +TGT_SEC_HDL_VAR(0, SEC_CTX_INIT, tgt_sec_ctx_handle), +TGT_SEC_HDL_VAR(0, SEC_CTX_INIT_CONT, tgt_sec_ctx_handle), +TGT_SEC_HDL_VAR(0, SEC_CTX_FINI, tgt_sec_ctx_handle), +}; +EXPORT_SYMBOL(tgt_sec_ctx_handlers); + int (*tgt_lfsck_in_notify)(const struct lu_env *env, struct dt_device *key, struct lfsck_request *lr, -- 1.8.3.1