Whamcloud - gitweb
LU-559 Keep the o_seq unchanged for 1.8 client
authorNiu Yawei <niu@whamcloud.com>
Thu, 4 Aug 2011 06:31:10 +0000 (23:31 -0700)
committerOleg Drokin <green@whamcloud.com>
Tue, 9 Aug 2011 15:13:24 +0000 (11:13 -0400)
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 <niu@whamcloud.com>
Change-Id: I93cd3bdbf984f8aef0f5b68f5ee8640f31ded337
Reviewed-on: http://review.whamcloud.com/1182
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: wangdi <di.wang@whamcloud.com>
lustre/obdfilter/filter.c
lustre/ost/ost_handler.c

index cb1b787..609aaeb 100644 (file)
@@ -4023,7 +4023,17 @@ int filter_create(struct obd_export *exp, struct obdo *oa,
         fed = &exp->exp_filter_data;
         filter = &obd->u.filter;
 
         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 "
                 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 "
index 565b0b8..ce5971a 100644 (file)
@@ -83,17 +83,15 @@ static void ost_drop_id(struct obd_export *exp, struct obdo *oa)
 
 /**
  * Validate oa from client.
 
 /**
  * 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)
 {
  */
 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;
                 oa->o_seq = FID_SEQ_OST_MDT0;
                 if (ioobj)
                         ioobj->ioo_seq = FID_SEQ_OST_MDT0;