Whamcloud - gitweb
LU-4008 mdt: Shrink default LOVEA reply buffers
[fs/lustre-release.git] / lustre / mdt / mdt_lib.c
index 0b0339c..ae30238 100644 (file)
@@ -628,16 +628,19 @@ int mdt_fix_reply(struct mdt_thread_info *info)
          * buffers before growing it */
        if (info->mti_big_lmm_used) {
                 LASSERT(req_capsule_has_field(pill, &RMF_MDT_MD, RCL_SERVER));
-                md_packed = req_capsule_get_size(pill, &RMF_MDT_MD,
-                                                 RCL_SERVER);
-                LASSERT(md_packed > 0);
-                /* buffer must be allocated separately */
-                LASSERT(info->mti_attr.ma_lmm !=
-                        req_capsule_server_get(pill, &RMF_MDT_MD));
-                req_capsule_shrink(pill, &RMF_MDT_MD, 0, RCL_SERVER);
+
                 /* free big lmm if md_size is not needed */
-                if (md_size == 0)
+               if (md_size == 0) {
                        info->mti_big_lmm_used = 0;
+               } else {
+                       md_packed = req_capsule_get_size(pill, &RMF_MDT_MD,
+                                                        RCL_SERVER);
+                       LASSERT(md_packed > 0);
+                       /* buffer must be allocated separately */
+                       LASSERT(info->mti_attr.ma_lmm !=
+                               req_capsule_server_get(pill, &RMF_MDT_MD));
+                       req_capsule_shrink(pill, &RMF_MDT_MD, 0, RCL_SERVER);
+               }
         } else if (req_capsule_has_field(pill, &RMF_MDT_MD, RCL_SERVER)) {
                 req_capsule_shrink(pill, &RMF_MDT_MD, md_size, RCL_SERVER);
         }
@@ -725,11 +728,6 @@ int mdt_handle_last_unlink(struct mdt_thread_info *info, struct mdt_object *mo,
         }
        repbody->eadatasize = 0;
 
-        if (ma->ma_cookie_size && (ma->ma_valid & MA_COOKIE)) {
-                repbody->aclsize = ma->ma_cookie_size;
-                repbody->valid |= OBD_MD_FLCOOKIE;
-        }
-
        if (info->mti_mdt->mdt_lut.lut_oss_capa &&
            exp_connect_flags(info->mti_exp) & OBD_CONNECT_OSS_CAPA &&
            repbody->valid & OBD_MD_FLEASIZE) {