X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fmdt%2Fmdt_lib.c;h=fa1d9ff96b6e79bc7d3d6a198f40df7e4c43add0;hp=ae3023844cb5357cd0378ea88fed65fb46c48f3d;hb=ff8087913c579daac8ba620cbb3aa45277b7cd18;hpb=00260466f9c84f21e6db55d5dd6e87e8a9906438 diff --git a/lustre/mdt/mdt_lib.c b/lustre/mdt/mdt_lib.c index ae30238..fa1d9ff 100644 --- a/lustre/mdt/mdt_lib.c +++ b/lustre/mdt/mdt_lib.c @@ -95,28 +95,28 @@ static int match_nosquash_list(struct rw_semaphore *sem, static int mdt_root_squash(struct mdt_thread_info *info, lnet_nid_t peernid) { struct lu_ucred *ucred = mdt_ucred(info); + struct root_squash_info *squash = &info->mti_mdt->mdt_squash; ENTRY; LASSERT(ucred != NULL); - if (!info->mti_mdt->mdt_squash_uid || ucred->uc_fsuid) + if (!squash->rsi_uid || ucred->uc_fsuid) RETURN(0); - if (match_nosquash_list(&info->mti_mdt->mdt_squash_sem, - &info->mti_mdt->mdt_nosquash_nids, - peernid)) { - CDEBUG(D_OTHER, "%s is in nosquash_nids list\n", - libcfs_nid2str(peernid)); - RETURN(0); - } + if (match_nosquash_list(&squash->rsi_sem, + &squash->rsi_nosquash_nids, + peernid)) { + CDEBUG(D_OTHER, "%s is in nosquash_nids list\n", + libcfs_nid2str(peernid)); + RETURN(0); + } CDEBUG(D_OTHER, "squash req from %s, (%d:%d/%x)=>(%d:%d/%x)\n", libcfs_nid2str(peernid), ucred->uc_fsuid, ucred->uc_fsgid, ucred->uc_cap, - info->mti_mdt->mdt_squash_uid, info->mti_mdt->mdt_squash_gid, - 0); + squash->rsi_uid, squash->rsi_gid, 0); - ucred->uc_fsuid = info->mti_mdt->mdt_squash_uid; - ucred->uc_fsgid = info->mti_mdt->mdt_squash_gid; + ucred->uc_fsuid = squash->rsi_uid; + ucred->uc_fsgid = squash->rsi_gid; ucred->uc_cap = 0; ucred->uc_suppgids[0] = -1; ucred->uc_suppgids[1] = -1; @@ -576,6 +576,10 @@ void mdt_dump_lmv(unsigned int level, const union lmv_mds_md *lmv) le32_to_cpu(lmm1->lmv_magic), le32_to_cpu(lmm1->lmv_master_mdt_index), le32_to_cpu(lmm1->lmv_stripe_count)); + + if (le32_to_cpu(lmm1->lmv_magic) == LMV_MAGIC_STRIPE) + return; + for (i = 0; i < le32_to_cpu(lmm1->lmv_stripe_count); i++) { struct lu_fid fid; @@ -627,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));