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>
/* MDT_MD buffer may be bigger than packed value, let's shrink all
* buffers before growing it */
if (info->mti_big_lmm_used) {
/* 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 {
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));
/* buffer must be allocated separately */
LASSERT(info->mti_attr.ma_lmm !=
req_capsule_server_get(pill, &RMF_MDT_MD));
unlock_child:
mdt_unlock_slaves(info, mc, MDS_INODELOCK_UPDATE, s0_lh, s0_obj, einfo);
mdt_object_unlock(info, mc, child_lh, rc);
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:
put_child:
mdt_object_put(info->mti_env, mc);
unlock_parent: