Whamcloud - gitweb
LU-6356 tgt: add handlers for SEC_CTX_* requests 24/16124/2
authorSebastien Buisson <sebastien.buisson@bull.net>
Fri, 28 Aug 2015 09:19:00 +0000 (11:19 +0200)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 16 Sep 2015 01:06:36 +0000 (01:06 +0000)
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 <sebastien.buisson@bull.net>
Change-Id: Ifadaff9d7f07cf4c6a75cd1f5054378aaca27c26
Reviewed-on: http://review.whamcloud.com/16124
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Andrew Perepechko <andrew.perepechko@seagate.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/lu_target.h
lustre/mgs/mgs_handler.c
lustre/ofd/ofd_dev.c
lustre/target/tgt_handler.c

index 7189ba7..9b62156 100644 (file)
@@ -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[];
index c2041ce..8c2c8ea 100644 (file)
@@ -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
        }
 };
index e4ddf91..a55a234 100644 (file)
@@ -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
        }
 };
index 53a7867..1110902 100644 (file)
@@ -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,