Whamcloud - gitweb
LU-4877 mdt: tolerate zero md_packed in mdt_fix_reply 16/10116/2
authorMikhail Pershin <mike.pershin@intel.com>
Sun, 27 Apr 2014 07:08:31 +0000 (11:08 +0400)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 13 May 2014 14:42:55 +0000 (14:42 +0000)
The assertion for md_packed value is not really needed there,
if it is zero then buffer is not packed in reply and is not
needed, it is enough just unmark big buffer usage.

Signed-off-by: Mikhail Pershin <mike.pershin@intel.com>
Change-Id: I4db92ce2ef492069db4dbd4d07c0d69770130fad
Reviewed-on: http://review.whamcloud.com/10116
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: wangdi <di.wang@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/mdt/mdt_lib.c
lustre/mdt/mdt_reint.c

index eb839a6..fa1d9ff 100644 (file)
@@ -631,15 +631,16 @@ int mdt_fix_reply(struct mdt_thread_info *info)
         /* MDT_MD buffer may be bigger than packed value, let's shrink all
          * buffers before growing it */
        if (info->mti_big_lmm_used) {
-                LASSERT(req_capsule_has_field(pill, &RMF_MDT_MD, RCL_SERVER));
+               /* big_lmm buffer may be used even without packing the result
+                * into reply, just for internal server needs */
+               if (req_capsule_has_field(pill, &RMF_MDT_MD, RCL_SERVER))
+                       md_packed = req_capsule_get_size(pill, &RMF_MDT_MD,
+                                                        RCL_SERVER);
 
-                /* free big lmm if md_size is not needed */
-               if (md_size == 0) {
+               /* free big lmm if md_size is not needed */
+               if (md_size == 0 || md_packed == 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));
index 1cdb175..23d7079 100644 (file)
@@ -1016,11 +1016,6 @@ static int mdt_reint_unlink(struct mdt_thread_info *info,
 unlock_child:
        mdt_unlock_slaves(info, mc, MDS_INODELOCK_UPDATE, s0_lh, s0_obj, einfo);
        mdt_object_unlock(info, mc, child_lh, rc);
-
-       /* Since we do not need reply md striped dir info to client, so
-        * reset mti_big_lmm_used to avoid confusing mdt_fix_reply */
-       if (info->mti_big_lmm_used)
-               info->mti_big_lmm_used = 0;
 put_child:
        mdt_object_put(info->mti_env, mc);
 unlock_parent: