From 97e7c60bd9b2135ff5d498009b3996507fe6654b Mon Sep 17 00:00:00 2001 From: Niu Yawei Date: Wed, 3 Aug 2011 23:31:10 -0700 Subject: [PATCH] LU-559 Keep the o_seq unchanged for 1.8 client ost_validate_obdo() arbitrarily change the o_seq to 0 for the requests from 1.8 client, which will make the 1.8 echo client use the 0 group mistakenly. In fact, I think we needn't do anything special for the 1.8 client here. Signed-off-by: Niu Yawei Change-Id: I93cd3bdbf984f8aef0f5b68f5ee8640f31ded337 Reviewed-on: http://review.whamcloud.com/1182 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: wangdi --- lustre/obdfilter/filter.c | 12 +++++++++++- lustre/ost/ost_handler.c | 12 +++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index cb1b787..609aaeb 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -4023,7 +4023,17 @@ int filter_create(struct obd_export *exp, struct obdo *oa, fed = &exp->exp_filter_data; filter = &obd->u.filter; - if (fed->fed_group != oa->o_seq) { + /* 1.8 client doesn't carry the ocd_group with connect request, + * so the fed_group will always be zero for 1.8 client. */ + if (!(exp->exp_connect_flags & OBD_CONNECT_FULL20)) { + if (oa->o_seq != FID_SEQ_OST_MDT0 && + oa->o_seq != FID_SEQ_LLOG && + oa->o_seq != FID_SEQ_ECHO) { + CERROR("The request from older client has invalid" + " group "LPU64"!\n", oa->o_seq); + RETURN(-EINVAL); + } + } else if (fed->fed_group != oa->o_seq) { CERROR("%s: this export (nid %s) used object group %d " "earlier; now it's trying to use group "LPU64"!" " This could be a bug in the MDS. Please report to " diff --git a/lustre/ost/ost_handler.c b/lustre/ost/ost_handler.c index 565b0b8..ce5971a 100644 --- a/lustre/ost/ost_handler.c +++ b/lustre/ost/ost_handler.c @@ -83,17 +83,15 @@ static void ost_drop_id(struct obd_export *exp, struct obdo *oa) /** * Validate oa from client. - * 1. If the request comes from 1.8 clients, it will reset o_seq with MDT0. - * 2. If the request comes from 2.0 clients, currently only RSVD seq and IDIF - * req are valid. - * a. for single MDS seq = FID_SEQ_OST_MDT0, - * b. for CMD, seq = FID_SEQ_OST_MDT0, FID_SEQ_OST_MDT1 - FID_SEQ_OST_MAX + * If the request comes from 2.0 clients, currently only RSVD seq and IDIF + * req are valid. + * a. for single MDS seq = FID_SEQ_OST_MDT0, + * b. for CMD, seq = FID_SEQ_OST_MDT0, FID_SEQ_OST_MDT1 - FID_SEQ_OST_MAX */ static int ost_validate_obdo(struct obd_export *exp, struct obdo *oa, struct obd_ioobj *ioobj) { - if (oa != NULL && (!(oa->o_valid & OBD_MD_FLGROUP) || - !(exp->exp_connect_flags & OBD_CONNECT_FULL20))) { + if (oa != NULL && !(oa->o_valid & OBD_MD_FLGROUP)) { oa->o_seq = FID_SEQ_OST_MDT0; if (ioobj) ioobj->ioo_seq = FID_SEQ_OST_MDT0; -- 1.8.3.1