From: tappro Date: Mon, 4 Sep 2006 22:19:47 +0000 (+0000) Subject: add fsuid, fsgid to the struct md_op_data, set them in lmv instead of mdc X-Git-Tag: v1_8_0_110~486^2~1018 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=0131691758905304737d3154ac106719c9aa15dd;p=fs%2Flustre-release.git add fsuid, fsgid to the struct md_op_data, set them in lmv instead of mdc because mdc is used also on mds for cross-ref operations --- diff --git a/lustre/include/lustre/lustre_idl.h b/lustre/include/lustre/lustre_idl.h index b6d1ddf..b297be5 100644 --- a/lustre/include/lustre/lustre_idl.h +++ b/lustre/include/lustre/lustre_idl.h @@ -613,7 +613,8 @@ struct md_op_data { struct lmv_stripe_md *mea1; struct lmv_stripe_md *mea2; __u32 suppgids[2]; - + __u32 fsuid; + __u32 fsgid; /* part of obdo fields for md stack */ obd_valid valid; obd_size size; diff --git a/lustre/lmv/lmv_obd.c b/lustre/lmv/lmv_obd.c index 3738eba..39a80b2 100644 --- a/lustre/lmv/lmv_obd.c +++ b/lustre/lmv/lmv_obd.c @@ -1581,6 +1581,8 @@ static int lmv_link(struct obd_export *exp, struct md_op_data *op_data, CDEBUG(D_OTHER, "forward to MDS #"LPU64" ("DFID")\n", mds, PFID(&op_data->fid1)); + op_data->fsuid = current->fsuid; + op_data->fsgid = current->fsgid; rc = md_link(lmv->tgts[mds].ltd_exp, op_data, request); RETURN(rc); @@ -1678,7 +1680,8 @@ request: PFID(&op_data->fid1), oldlen, old, PFID(&op_data->fid2), newlen, new); } - + op_data->fsuid = current->fsuid; + op_data->fsgid = current->fsgid; rc = md_rename(lmv->tgts[mds].ltd_exp, op_data, old, oldlen, new, newlen, request); RETURN(rc); @@ -1877,7 +1880,8 @@ static int lmv_unlink_slaves(struct obd_export *exp, memset(op_data2, 0, sizeof(*op_data2)); op_data2->fid1 = mea->mea_ids[i]; op_data2->create_mode = MDS_MODE_DONT_LOCK | S_IFDIR; - + op_data2->fsuid = current->fsuid; + op_data2->fsgid = current->fsgid; tgt_exp = lmv_get_export(lmv, &op_data2->fid1); if (IS_ERR(tgt_exp)) GOTO(out_free_op_data2, rc = PTR_ERR(tgt_exp)); @@ -1943,7 +1947,8 @@ static int lmv_unlink(struct obd_export *exp, struct md_op_data *op_data, tgt_exp = lmv_get_export(lmv, &op_data->fid1); if (IS_ERR(tgt_exp)) RETURN(PTR_ERR(tgt_exp)); - + op_data->fsuid = current->fsuid; + op_data->fsgid = current->fsgid; rc = md_unlink(tgt_exp, op_data, request); RETURN(rc); } diff --git a/lustre/mdc/mdc_lib.c b/lustre/mdc/mdc_lib.c index 19accd5..e4d0f12 100644 --- a/lustre/mdc/mdc_lib.c +++ b/lustre/mdc/mdc_lib.c @@ -228,8 +228,8 @@ void mdc_unlink_pack(struct ptlrpc_request *req, int offset, LASSERT (rec != NULL); rec->ul_opcode = REINT_UNLINK; - rec->ul_fsuid = current->fsuid; - rec->ul_fsgid = current->fsgid; + rec->ul_fsuid = op_data->fsuid;//current->fsuid; + rec->ul_fsgid = op_data->fsgid;//current->fsgid; rec->ul_cap = current->cap_effective; rec->ul_mode = op_data->create_mode; rec->ul_suppgid = op_data->suppgids[0]; @@ -251,8 +251,8 @@ void mdc_link_pack(struct ptlrpc_request *req, int offset, rec = lustre_msg_buf(req->rq_reqmsg, offset, sizeof (*rec)); rec->lk_opcode = REINT_LINK; - rec->lk_fsuid = current->fsuid; - rec->lk_fsgid = current->fsgid; + rec->lk_fsuid = op_data->fsuid;//current->fsuid; + rec->lk_fsgid = op_data->fsgid;//current->fsgid; rec->lk_cap = current->cap_effective; rec->lk_suppgid1 = op_data->suppgids[0]; rec->lk_suppgid2 = op_data->suppgids[1]; @@ -275,8 +275,8 @@ void mdc_rename_pack(struct ptlrpc_request *req, int offset, /* XXX do something about time, uid, gid */ rec->rn_opcode = REINT_RENAME; - rec->rn_fsuid = current->fsuid; - rec->rn_fsgid = current->fsgid; + rec->rn_fsuid = op_data->fsuid;//current->fsuid; + rec->rn_fsgid = op_data->fsgid;//current->fsgid; rec->rn_cap = current->cap_effective; rec->rn_suppgid1 = op_data->suppgids[0]; rec->rn_suppgid2 = op_data->suppgids[1];