{
int serious = 0;
int rc;
+ __u32 opc = lustre_msg_get_opc(req->rq_reqmsg);
ENTRY;
+
+ /* When dealing with sec context requests, no export is associated yet,
+ * because these requests are sent before *_CONNECT requests.
+ * A NULL req->rq_export means the normal *_common_slice handlers will
+ * not be called, because there is no reference to the target.
+ * So deal with them by hand and jump directly to target_send_reply().
+ */
+ switch (opc) {
+ case SEC_CTX_INIT:
+ case SEC_CTX_INIT_CONT:
+ case SEC_CTX_FINI:
+ GOTO(out, rc = 0);
+ }
+
/*
* Checking for various OBD_FAIL_$PREF_$OPC_NET codes. _Do_ not try
* to put same checks into handlers like mdt_close(), mdt_reint(),
if (likely(rc == 0 && req->rq_export))
target_committed_to_req(req);
+out:
target_send_reply(req, rc, tsi->tsi_reply_fail_id);
RETURN(0);
}
}
if (unlikely(!class_connected_export(req->rq_export))) {
+ if (opc == SEC_CTX_INIT || opc == SEC_CTX_INIT_CONT ||
+ opc == SEC_CTX_FINI) {
+ /* sec context initialization has to be handled
+ * by hand in tgt_handle_request0() */
+ tsi->tsi_reply_fail_id = OBD_FAIL_SEC_CTX_INIT_NET;
+ h = NULL;
+ GOTO(handle_recov, rc = 0);
+ }
CDEBUG(D_HA, "operation %d on unconnected OST from %s\n",
opc, libcfs_id2str(req->rq_peer));
req->rq_status = -ENOTCONN;
GOTO(out, rc);
}
+ LASSERTF(h->th_opc == opc, "opcode mismatch %d != %d\n",
+ h->th_opc, opc);
+
if (CFS_FAIL_CHECK_ORSET(request_fail_id, CFS_FAIL_ONCE))
GOTO(out, rc = 0);
GOTO(out, rc);
}
+handle_recov:
rc = tgt_handle_recovery(req, tsi->tsi_reply_fail_id);
if (likely(rc == 1)) {
- LASSERTF(h->th_opc == opc, "opcode mismatch %d != %d\n",
- h->th_opc, opc);
rc = tgt_handle_request0(tsi, h, req);
if (rc)
GOTO(out, rc);
};
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,