X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fmdc%2Fmdc_locks.c;h=6699f1cb7b0c7b2fdfe8aed7b737614f959a38bf;hp=10c1f2ccd3db3381bc2c544d465454f16760700c;hb=40d91eafe257;hpb=11fcbfa9de4a5170abc2c5df2a6e4e02f0f84268 diff --git a/lustre/mdc/mdc_locks.c b/lustre/mdc/mdc_locks.c index 10c1f2c..6699f1c 100644 --- a/lustre/mdc/mdc_locks.c +++ b/lustre/mdc/mdc_locks.c @@ -326,6 +326,9 @@ mdc_intent_open_pack(struct obd_export *exp, struct lookup_intent *it, req_capsule_set_size(&req->rq_pill, &RMF_FILE_SECCTX, RCL_CLIENT, op_data->op_file_secctx_size); + req_capsule_set_size(&req->rq_pill, &RMF_FILE_ENCCTX, RCL_CLIENT, + op_data->op_file_encctx_size); + /* get SELinux policy info if any */ rc = sptlrpc_get_sepol(req); if (rc < 0) { @@ -382,6 +385,15 @@ mdc_intent_open_pack(struct obd_export *exp, struct lookup_intent *it, RCL_SERVER, 0); } + if (exp_connect_encrypt(exp) && !(it->it_op & IT_CREAT) && + it->it_op & IT_OPEN) + req_capsule_set_size(&req->rq_pill, &RMF_FILE_ENCCTX, + RCL_SERVER, + obd->u.cli.cl_max_mds_easize); + else + req_capsule_set_size(&req->rq_pill, &RMF_FILE_ENCCTX, + RCL_SERVER, 0); + /** * Inline buffer for possible data from Data-on-MDT files. */ @@ -462,6 +474,9 @@ mdc_intent_getxattr_pack(struct obd_export *exp, struct lookup_intent *it, /* pack the intent */ lit = req_capsule_client_get(&req->rq_pill, &RMF_LDLM_INTENT); lit->opc = IT_GETXATTR; + /* Message below is checked in sanity-selinux test_20d + * and sanity-sec test_49 + */ CDEBUG(D_INFO, "%s: get xattrs for "DFID"\n", exp->exp_obd->obd_name, PFID(&op_data->op_fid1)); @@ -576,6 +591,13 @@ mdc_intent_getattr_pack(struct obd_export *exp, struct lookup_intent *it, RCL_SERVER, 0); } + if (exp_connect_encrypt(exp) && it->it_op & (IT_LOOKUP | IT_GETATTR)) + req_capsule_set_size(&req->rq_pill, &RMF_FILE_ENCCTX, + RCL_SERVER, easize); + else + req_capsule_set_size(&req->rq_pill, &RMF_FILE_ENCCTX, + RCL_SERVER, 0); + ptlrpc_request_set_replen(req); RETURN(req); }