+
+ /* Grow MD buffer if needed finally */
+ if (info->mti_big_lmm_used) {
+ void *lmm;
+
+ LASSERT(md_size > md_packed);
+ CDEBUG(D_INFO, "Enlarge reply buffer, need extra %d bytes\n",
+ md_size - md_packed);
+ rc = req_capsule_server_grow(pill, &RMF_MDT_MD, md_size);
+ if (rc) {
+ /* we can't answer with proper LOV EA, drop flags,
+ * the rc is also returned so this request is
+ * considered as failed */
+ body->valid &= ~(OBD_MD_FLDIREA | OBD_MD_FLEASIZE);
+ /* don't return transno along with error */
+ lustre_msg_set_transno(pill->rc_req->rq_repmsg, 0);
+ } else {
+ /* now we need to pack right LOV EA */
+ lmm = req_capsule_server_get(pill, &RMF_MDT_MD);
+ LASSERT(req_capsule_get_size(pill, &RMF_MDT_MD,
+ RCL_SERVER) ==
+ info->mti_attr.ma_lmm_size);
+ memcpy(lmm, info->mti_attr.ma_lmm,
+ info->mti_attr.ma_lmm_size);
+ }
+ /* update mdt_max_mdsize so clients will be aware about that */
+ if (info->mti_mdt->mdt_max_mdsize < info->mti_attr.ma_lmm_size)
+ info->mti_mdt->mdt_max_mdsize =
+ info->mti_attr.ma_lmm_size;
+ info->mti_big_lmm_used = 0;
+ }
+ RETURN(rc);