From: nasf Date: Tue, 7 Jun 2011 03:41:24 +0000 (+0800) Subject: LU-397 Set 'lsr_flags' as 'LU_SEQ_RANGE_MDT' for old 2.0 client X-Git-Tag: 2.0.63.0~10 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=47bd80c90b9875871ceacbba75d6ef7157e89e73 LU-397 Set 'lsr_flags' as 'LU_SEQ_RANGE_MDT' for old 2.0 client Lustre 2.x introduces server identifier into lu_seq_range to distinguish MDT and OST fids. But for old 2.0 client, it does not specify such identifier/flags. So use 'OBD_CONNECT_SEQ_RANGE' to distinguish whether it is old 2.0 client or not. For old 2.0 client, set the 'lsr_flags' as 'LU_SEQ_RANGE_MDT' by default. Change-Id: I652caa637959268e1da499370a0efd356ff98bbe Signed-off-by: nasf Reviewed-on: http://review.whamcloud.com/902 Reviewed-by: Andreas Dilger Tested-by: Hudson Reviewed-by: Oleg Drokin --- diff --git a/lustre/cmm/mdc_device.c b/lustre/cmm/mdc_device.c index 416233d..27c5d63 100644 --- a/lustre/cmm/mdc_device.c +++ b/lustre/cmm/mdc_device.c @@ -159,7 +159,8 @@ static int mdc_obd_add(const struct lu_env *env, OBD_CONNECT_MDS_MDS | OBD_CONNECT_FID | OBD_CONNECT_AT | - OBD_CONNECT_FULL20; + OBD_CONNECT_FULL20 | + OBD_CONNECT_64BITHASH; rc = obd_connect(env, &desc->cl_exp, mdc, &mdc->obd_uuid, ocd, NULL); OBD_FREE_PTR(ocd); if (rc) { diff --git a/lustre/fld/fld_handler.c b/lustre/fld/fld_handler.c index 9a30103..ae9520a 100644 --- a/lustre/fld/fld_handler.c +++ b/lustre/fld/fld_handler.c @@ -342,15 +342,14 @@ static int fld_server_handle(struct lu_server_fld *fld, static int fld_req_handle(struct ptlrpc_request *req, struct fld_thread_info *info) { - struct lu_site *site; + struct obd_export *exp = req->rq_export; + struct lu_site *site = exp->exp_obd->obd_lu_dev->ld_site; struct lu_seq_range *in; struct lu_seq_range *out; int rc; __u32 *opc; ENTRY; - site = req->rq_export->exp_obd->obd_lu_dev->ld_site; - rc = req_capsule_server_pack(info->fti_pill); if (rc) RETURN(err_serious(rc)); @@ -365,6 +364,13 @@ static int fld_req_handle(struct ptlrpc_request *req, RETURN(err_serious(-EPROTO)); *out = *in; + /* For old 2.0 client, the 'lsr_flags' is uninitialized. + * Set it as 'LU_SEQ_RANGE_MDT' by default. + * Old 2.0 liblustre client cannot talk with new 2.1 server. */ + if (!(exp->exp_connect_flags & OBD_CONNECT_64BITHASH) && + !exp->exp_libclient) + out->lsr_flags = LU_SEQ_RANGE_MDT; + rc = fld_server_handle(lu_site2md(site)->ms_server_fld, req->rq_svc_thread->t_env, *opc, out, info); diff --git a/lustre/include/lustre/lustre_idl.h b/lustre/include/lustre/lustre_idl.h index 3bdebf1..54e915c 100644 --- a/lustre/include/lustre/lustre_idl.h +++ b/lustre/include/lustre/lustre_idl.h @@ -1105,7 +1105,8 @@ extern void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb); OBD_CONNECT_OSS_CAPA | OBD_CONNECT_RMT_CLIENT | \ OBD_CONNECT_RMT_CLIENT_FORCE | OBD_CONNECT_VBR | \ OBD_CONNECT_MDS | OBD_CONNECT_SKIP_ORPHAN | \ - OBD_CONNECT_GRANT_SHRINK | OBD_CONNECT_FULL20) + OBD_CONNECT_GRANT_SHRINK | OBD_CONNECT_FULL20 | \ + OBD_CONNECT_64BITHASH) #define ECHO_CONNECT_SUPPORTED (0) #define MGS_CONNECT_SUPPORTED (OBD_CONNECT_VERSION | OBD_CONNECT_AT | \ OBD_CONNECT_FULL20) diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 954f4ff..d9635a1 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -355,7 +355,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt, OBD_CONNECT_SRVLOCK | OBD_CONNECT_TRUNCLOCK| OBD_CONNECT_AT | OBD_CONNECT_RMT_CLIENT | OBD_CONNECT_OSS_CAPA | OBD_CONNECT_VBR| - OBD_CONNECT_FULL20; + OBD_CONNECT_FULL20 | OBD_CONNECT_64BITHASH; if (sbi->ll_flags & LL_SBI_SOM_PREVIEW) data->ocd_connect_flags |= OBD_CONNECT_SOM; diff --git a/lustre/mds/mds_lov.c b/lustre/mds/mds_lov.c index 40d477d..8225a53 100644 --- a/lustre/mds/mds_lov.c +++ b/lustre/mds/mds_lov.c @@ -718,7 +718,8 @@ int mds_lov_connect(struct obd_device *obd, char * lov_name) OBD_CONNECT_BRW_SIZE | OBD_CONNECT_CKSUM | OBD_CONNECT_CHANGE_QS | OBD_CONNECT_AT | OBD_CONNECT_MDS | OBD_CONNECT_SKIP_ORPHAN | - OBD_CONNECT_SOM | OBD_CONNECT_FULL20; + OBD_CONNECT_SOM | OBD_CONNECT_FULL20 | + OBD_CONNECT_64BITHASH; #ifdef HAVE_LRU_RESIZE_SUPPORT data->ocd_connect_flags |= OBD_CONNECT_LRU_RESIZE; #endif diff --git a/lustre/obdecho/echo_client.c b/lustre/obdecho/echo_client.c index 41a8e90..512ad9b 100644 --- a/lustre/obdecho/echo_client.c +++ b/lustre/obdecho/echo_client.c @@ -1982,7 +1982,8 @@ static int echo_client_setup(struct obd_device *obddev, struct lustre_cfg *lcfg) } ocd->ocd_connect_flags = OBD_CONNECT_VERSION | OBD_CONNECT_REQPORTAL | - OBD_CONNECT_GRANT | OBD_CONNECT_FULL20; + OBD_CONNECT_GRANT | OBD_CONNECT_FULL20 | + OBD_CONNECT_64BITHASH; ocd->ocd_version = LUSTRE_VERSION_CODE; ocd->ocd_group = FID_SEQ_ECHO;