From 4ca5d7edf564f27b947d428d4de581df548127ab Mon Sep 17 00:00:00 2001 From: yury Date: Fri, 11 Aug 2006 11:39:54 +0000 Subject: [PATCH] - fixed bug in seq_server_init(), there should be separate portal for data stack. --- lustre/fid/fid_handler.c | 11 +++++------ lustre/fid/fid_request.c | 13 ++++++++++--- lustre/include/lustre/lustre_idl.h | 5 +++-- lustre/include/lustre_fid.h | 11 ++++++++++- lustre/mdc/mdc_request.c | 3 ++- lustre/mdt/mdt_handler.c | 3 ++- 6 files changed, 32 insertions(+), 14 deletions(-) diff --git a/lustre/fid/fid_handler.c b/lustre/fid/fid_handler.c index 8aabf4d..6d058da 100644 --- a/lustre/fid/fid_handler.c +++ b/lustre/fid/fid_handler.c @@ -465,17 +465,16 @@ int seq_server_init(struct lu_server_seq *seq, enum lu_mgr_type type, const struct lu_context *ctx) { - int is_srv = type == LUSTRE_SEQ_SERVER; + int rc, is_srv = (type == LUSTRE_SEQ_SERVER); - int rc, req_portal = is_srv ? - SEQ_SERVER_PORTAL : SEQ_CONTROLLER_PORTAL; - struct ptlrpc_service_conf seq_md_conf = { .psc_nbufs = MDS_NBUFS, .psc_bufsize = MDS_BUFSIZE, .psc_max_req_size = SEQ_MAXREQSIZE, .psc_max_reply_size = SEQ_MAXREPSIZE, - .psc_req_portal = req_portal, + .psc_req_portal = (is_srv ? + SEQ_METADATA_PORTAL : + SEQ_CONTROLLER_PORTAL), .psc_rep_portal = MDC_REPLY_PORTAL, .psc_watchdog_timeout = SEQ_SERVICE_WATCHDOG_TIMEOUT, .psc_num_threads = SEQ_NUM_THREADS, @@ -486,7 +485,7 @@ int seq_server_init(struct lu_server_seq *seq, .psc_bufsize = MDS_BUFSIZE, .psc_max_req_size = SEQ_MAXREQSIZE, .psc_max_reply_size = SEQ_MAXREPSIZE, - .psc_req_portal = SEQ_SERVER_PORTAL, + .psc_req_portal = SEQ_DATA_PORTAL, .psc_rep_portal = OSC_REPLY_PORTAL, .psc_watchdog_timeout = SEQ_SERVICE_WATCHDOG_TIMEOUT, .psc_num_threads = SEQ_NUM_THREADS, diff --git a/lustre/fid/fid_request.c b/lustre/fid/fid_request.c index ed211cb..1283518 100644 --- a/lustre/fid/fid_request.c +++ b/lustre/fid/fid_request.c @@ -76,8 +76,13 @@ static int seq_client_rpc(struct lu_client_seq *seq, req->rq_replen = lustre_msg_size(1, &repsize); - req->rq_request_portal = (opc == SEQ_ALLOC_SUPER) ? - SEQ_CONTROLLER_PORTAL : SEQ_SERVER_PORTAL; + if (seq->lcs_type == LUSTRE_SEQ_METADATA) { + req->rq_request_portal = (opc == SEQ_ALLOC_SUPER) ? + SEQ_CONTROLLER_PORTAL : SEQ_METADATA_PORTAL; + } else { + req->rq_request_portal = (opc == SEQ_ALLOC_SUPER) ? + SEQ_CONTROLLER_PORTAL : SEQ_DATA_PORTAL; + } rc = ptlrpc_queue_wait(req); if (rc) @@ -300,13 +305,15 @@ static void seq_client_proc_fini(struct lu_client_seq *seq) int seq_client_init(struct lu_client_seq *seq, const char *uuid, - struct obd_export *exp) + struct obd_export *exp, + enum lu_cli_type type) { int rc = 0; ENTRY; LASSERT(exp != NULL); + seq->lcs_type = type; fid_zero(&seq->lcs_fid); range_zero(&seq->lcs_range); sema_init(&seq->lcs_sem, 1); diff --git a/lustre/include/lustre/lustre_idl.h b/lustre/include/lustre/lustre_idl.h index 91d07f3..8b0b19d 100644 --- a/lustre/include/lustre/lustre_idl.h +++ b/lustre/include/lustre/lustre_idl.h @@ -98,8 +98,9 @@ #define MGS_REPLY_PORTAL 27 #define OST_REQUEST_PORTAL 28 #define FLD_REQUEST_PORTAL 29 -#define SEQ_SERVER_PORTAL 30 -#define SEQ_CONTROLLER_PORTAL 31 +#define SEQ_METADATA_PORTAL 30 +#define SEQ_DATA_PORTAL 31 +#define SEQ_CONTROLLER_PORTAL 32 #define SVC_KILLED 1 #define SVC_EVENT 2 diff --git a/lustre/include/lustre_fid.h b/lustre/include/lustre_fid.h index 829c0f3..527e2b4 100644 --- a/lustre/include/lustre_fid.h +++ b/lustre/include/lustre_fid.h @@ -56,6 +56,11 @@ enum lu_mgr_type { LUSTRE_SEQ_CONTROLLER }; +enum lu_cli_type { + LUSTRE_SEQ_METADATA, + LUSTRE_SEQ_DATA +}; + /* client sequence manager interface */ struct lu_client_seq { /* sequence-controller export. */ @@ -73,6 +78,9 @@ struct lu_client_seq { /* this holds last allocated fid in last obtained seq */ struct lu_fid lcs_fid; + /* LUSTRE_SEQ_METADATA or LUSTRE_SEQ_DATA */ + enum lu_cli_type lcs_type; + /* service uuid, passed from MDT + seq name to form unique seq name to * use it with procfs. */ char lcs_name[80]; @@ -147,7 +155,8 @@ int seq_server_set_cli(struct lu_server_seq *seq, int seq_client_init(struct lu_client_seq *seq, const char *uuid, - struct obd_export *exp); + struct obd_export *exp, + enum lu_cli_type type); void seq_client_fini(struct lu_client_seq *seq); diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index 1e9f981..74cf5a5 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -1107,7 +1107,8 @@ static int mdc_fid_init(struct obd_export *exp) /* init client side sequence-manager */ rc = seq_client_init(cli->cl_seq, - exp->exp_obd->obd_name, exp); + exp->exp_obd->obd_name, + exp, LUSTRE_SEQ_METADATA); if (rc) GOTO(out_free_seq, rc); diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index a95859c..91a9883 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -1886,7 +1886,8 @@ static int mdt_seq_init_cli(const struct lu_context *ctx, if (ls->ls_client_seq != NULL) { rc = seq_client_init(ls->ls_client_seq, mdc->obd_name, - ls->ls_client_exp); + ls->ls_client_exp, + LUSTRE_SEQ_METADATA); } else rc = -ENOMEM; -- 1.8.3.1