Whamcloud - gitweb
- "more sophisticated" fix for recovery-small.sh test_3. By now client and server...
authoryury <yury>
Tue, 19 Sep 2006 14:04:05 +0000 (14:04 +0000)
committeryury <yury>
Tue, 19 Sep 2006 14:04:05 +0000 (14:04 +0000)
- adjust maxrep size for seq and fld services. Values are oriented on case of using mds_v1 which is bigger.

lustre/include/lustre_net.h
lustre/mdc/mdc_request.c
lustre/mdt/mdt_lib.c

index 0b6818d..8bf199e 100644 (file)
 #define MDS_MAXREPSIZE  max(9 * 1024, 280 + LOV_MAX_STRIPE_COUNT * 56)
 
 /* FLD_MAXREQSIZE == lustre_msg + __u32 padding + ptlrpc_body + opc + md_fld */
-#define FLD_MAXREQSIZE  (168)
+#define FLD_MAXREQSIZE  (160)
 
-/* FLD_MAXREPSIZE == lustre_msg + __u32 padding + ptlrpc_body + md_fld */
-#define FLD_MAXREPSIZE  (160)
+/* FLD_MAXREPSIZE == lustre_msg + ptlrpc_body + md_fld */
+#define FLD_MAXREPSIZE  (152)
 
 /* SEQ_MAXREQSIZE == lustre_msg + __u32 padding + ptlrpc_body + opc + lu_range +
  * __u32 padding */
-#define SEQ_MAXREQSIZE  (168)
+#define SEQ_MAXREQSIZE  (160)
 
-/* SEQ_MAXREPSIZE == lustre_msg + __u32 padding + ptlrpc_body + lu_range */
-#define SEQ_MAXREPSIZE  (160)
+/* SEQ_MAXREPSIZE == lustre_msg + ptlrpc_body + lu_range */
+#define SEQ_MAXREPSIZE  (152)
 
 /* FIXME fix all constants here.  Andreas suggests dyamically adding threads. */
 #define MGS_MAX_THREADS 8UL
index fba1c67..9dd364b 100644 (file)
@@ -104,6 +104,16 @@ int mdc_getstatus(struct obd_export *exp, struct lu_fid *rootfid)
                               LUSTRE_IMP_FULL, 0);
 }
 
+/*
+ * This function now is known to always saying that it will receive 4 buffers
+ * from server. Even for cases when acl_size and md_size is zero, RPC header
+ * willcontain 4 fields and RPC itself will contain zero size fields. This is
+ * because mdt_getattr*() _always_ returns 4 fields, but if acl is not needed
+ * and thus zero, it shirinks it, making zero size. The same story about
+ * md_size. And this is course of problem when client waits for smaller number
+ * of fields. This issue will be fixed later when client gets awar of RPC
+ * layouts.  --umka
+ */
 static
 int mdc_getattr_common(struct obd_export *exp, unsigned int ea_size,
                        unsigned int acl_size, struct ptlrpc_request *req)
@@ -114,20 +124,19 @@ int mdc_getattr_common(struct obd_export *exp, unsigned int ea_size,
         int bufcount = 2, rc;
         ENTRY;
         
-        /* request message already built */
+        /* Request message already built. */
         if (ea_size != 0) {
-                size[bufcount++] = ea_size;
+                size[bufcount] = ea_size;
                 CDEBUG(D_INODE, "reserved %u bytes for MD/symlink in packet\n",
                        ea_size);
-        } else {
-                /* FIXME: reserve some memory even if we do not need it */
-                size[bufcount++] = 16;
         }
+        bufcount++;
         
         if (acl_size) {
-                size[bufcount++] = acl_size;
+                size[bufcount] = acl_size;
                 CDEBUG(D_INODE, "reserved %u bytes for ACL\n", acl_size);
         }
+        bufcount++;
 
         ptlrpc_req_set_repsize(req, bufcount, size);
 
@@ -176,8 +185,9 @@ int mdc_getattr(struct obd_export *exp, const struct lu_fid *fid,
         int acl_size = 0, rc;
         ENTRY;
 
-        /* XXX do we need to make another request here?  We just did a getattr
-         *     to do the lookup in the first place.
+        /*
+         * XXX do we need to make another request here?  We just did a getattr
+         * to do the lookup in the first place.
          */
         req = ptlrpc_prep_req(class_exp2cliimp(exp), LUSTRE_MDS_VERSION,
                               MDS_GETATTR, 2, size, NULL);
@@ -188,14 +198,8 @@ int mdc_getattr(struct obd_export *exp, const struct lu_fid *fid,
                           MDS_BFLAG_EXT_FLAGS/*request "new" flags(bug 9486)*/);
 
         /* currently only root inode will call us with FLACL */
-
-        /* FIXME:XXX:reserve enough space regardless the flag temporarily.
-         * server will do lustre_shrink_reply();
-         * 
-         *if (valid & OBD_MD_FLACL)
-         */
-        acl_size = LUSTRE_POSIX_ACL_MAX_SIZE;
-
+        if (valid & OBD_MD_FLACL)
+                acl_size = LUSTRE_POSIX_ACL_MAX_SIZE;
          
         rc = mdc_getattr_common(exp, ea_size, acl_size, req);
         if (rc != 0) {
index ae801c6..29d973d 100644 (file)
@@ -78,10 +78,10 @@ void mdt_shrink_reply(struct mdt_thread_info *info, int offset)
         acl_size = body->aclsize;
 
         CDEBUG(D_INFO, "Shrink to md_size %d cookie_size %d \n",
-                       md_size, acl_size);
+               md_size, acl_size);
 
         lustre_shrink_reply(req, offset, md_size, 1);
-        lustre_shrink_reply(req, md_size ? offset + 1: offset, acl_size, 0);
+        lustre_shrink_reply(req, md_size ? offset + 1 : offset, acl_size, 0);
 }