From ff8087913c579daac8ba620cbb3aa45277b7cd18 Mon Sep 17 00:00:00 2001 From: Mikhail Pershin Date: Sun, 27 Apr 2014 11:08:31 +0400 Subject: [PATCH] LU-4877 mdt: tolerate zero md_packed in mdt_fix_reply 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 Change-Id: I4db92ce2ef492069db4dbd4d07c0d69770130fad Reviewed-on: http://review.whamcloud.com/10116 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: John L. Hammond Reviewed-by: wangdi Reviewed-by: Oleg Drokin --- lustre/mdt/mdt_lib.c | 13 +++++++------ lustre/mdt/mdt_reint.c | 5 ----- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/lustre/mdt/mdt_lib.c b/lustre/mdt/mdt_lib.c index eb839a6..fa1d9ff 100644 --- a/lustre/mdt/mdt_lib.c +++ b/lustre/mdt/mdt_lib.c @@ -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)); diff --git a/lustre/mdt/mdt_reint.c b/lustre/mdt/mdt_reint.c index 1cdb175..23d7079 100644 --- a/lustre/mdt/mdt_reint.c +++ b/lustre/mdt/mdt_reint.c @@ -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: -- 1.8.3.1