Whamcloud - gitweb
Branch: b_new_cmd
authorwangdi <wangdi>
Fri, 4 Aug 2006 06:25:45 +0000 (06:25 +0000)
committerwangdi <wangdi>
Fri, 4 Aug 2006 06:25:45 +0000 (06:25 +0000)
1)set mdc_get_attr reply bufcount to 3(same as server side), since
  different buffer count will cause different reply size, although
  some msg might be zero.
2)set md size before pack reply in getattr_name

lustre/mdc/mdc_request.c
lustre/mdt/mdt_handler.c

index 14dc233..e1cc2d6 100644 (file)
@@ -111,21 +111,22 @@ int mdc_getattr_common(struct obd_export *exp, unsigned int ea_size,
         void            *eadata;
         int              rc;
         int              size[3] = {sizeof(*body)};
-        int              bufcount = 1;
+        int              bufcount = 3, offset = 1;
         ENTRY;
-
+        
         /* request message already built */
-
         if (ea_size != 0) {
-                size[bufcount++] = ea_size;
+                size[offset++] = ea_size;
                 CDEBUG(D_INODE, "reserved %u bytes for MD/symlink in packet\n",
                        ea_size);
         }
         if (acl_size) {
-                size[bufcount++] = acl_size;
+                size[offset++] = acl_size;
                 CDEBUG(D_INODE, "reserved %u bytes for ACL\n", acl_size);
         }
-
+        /*For new req layout, different bufcount will cause different 
+         *replen, so we should make client/server has same bufcount,
+         *so we set bufcount to 3 here, although some msg size might be 0*/
         req->rq_replen = lustre_msg_size(bufcount, size);
 
         mdc_get_rpc_lock(exp->exp_obd->u.cli.cl_rpc_lock, NULL);
index c58a77c..6351a24 100644 (file)
@@ -455,9 +455,11 @@ static int mdt_getattr_name(struct mdt_thread_info *info)
 
         ENTRY;
 
+        req_capsule_set_size(&info->mti_pill, &RMF_MDT_MD,
+                             RCL_SERVER, info->mti_mdt->mdt_max_mdsize);
         req_capsule_set_size(&info->mti_pill, &RMF_EADATA,
                              RCL_SERVER, LUSTRE_POSIX_ACL_MAX_SIZE);
-       
+        
         rc = req_capsule_pack(&info->mti_pill);
         if (rc)
                 RETURN(rc);