tsi->tsi_mdt_body = body;
- if (!(body->valid & OBD_MD_FLID))
+ if (!(body->mbo_valid & OBD_MD_FLID))
RETURN(0);
/* mdc_pack_body() doesn't check if fid is zero and set OBD_ML_FID
* in any case in pre-2.5 clients. Fix that here if needed */
- if (unlikely(fid_is_zero(&body->fid1)))
+ if (unlikely(fid_is_zero(&body->mbo_fid1)))
RETURN(0);
- if (!fid_is_sane(&body->fid1)) {
+ if (!fid_is_sane(&body->mbo_fid1)) {
CERROR("%s: invalid FID: "DFID"\n", tgt_name(tsi->tsi_tgt),
- PFID(&body->fid1));
+ PFID(&body->mbo_fid1));
RETURN(-EINVAL);
}
obj = lu_object_find(tsi->tsi_env,
&tsi->tsi_tgt->lut_bottom->dd_lu_dev,
- &body->fid1, NULL);
+ &body->mbo_fid1, NULL);
if (!IS_ERR(obj)) {
if ((flags & HABEO_CORPUS) && !lu_object_exists(obj)) {
lu_object_put(tsi->tsi_env, obj);
/* for capability renew ENOENT will be handled in
* mdt_renew_capa */
- if (body->valid & OBD_MD_FLOSSCAPA)
+ if (body->mbo_valid & OBD_MD_FLOSSCAPA)
rc = 0;
else
rc = -ENOENT;
rc = PTR_ERR(obj);
}
- tsi->tsi_fid = body->fid1;
+ tsi->tsi_fid = body->mbo_fid1;
RETURN(rc);
}
RCL_SERVER))
req_capsule_set_size(tsi->tsi_pill, &RMF_MDT_MD,
RCL_SERVER,
- tsi->tsi_mdt_body->eadatasize);
+ tsi->tsi_mdt_body->mbo_eadatasize);
if (req_capsule_has_field(tsi->tsi_pill, &RMF_LOGCOOKIES,
RCL_SERVER))
req_capsule_set_size(tsi->tsi_pill, &RMF_LOGCOOKIES,
RETURN(-EACCES);
}
} else {
- if (req->rq_auth_uid == INVALID_UID) {
+ if (!uid_valid(make_kuid(&init_user_ns, req->rq_auth_uid))) {
CDEBUG(D_SEC, "client %s -> target %s: user is not "
"authenticated!\n", client, tgt_name(tgt));
RETURN(-EACCES);
EXPORT_SYMBOL(tgt_obd_handlers);
int tgt_sync(const struct lu_env *env, struct lu_target *tgt,
- struct dt_object *obj)
+ struct dt_object *obj, __u64 start, __u64 end)
{
int rc = 0;
rc = dt_sync(env, tgt->lut_bottom);
} else if (dt_version_get(env, obj) >
tgt->lut_obd->obd_last_committed) {
- rc = dt_object_sync(env, obj);
+ rc = dt_object_sync(env, obj, start, end);
}
RETURN(rc);
(tgt->lut_sync_lock_cancel == ALWAYS_SYNC_ON_CANCEL ||
(tgt->lut_sync_lock_cancel == BLOCKING_SYNC_ON_CANCEL &&
lock->l_flags & LDLM_FL_CBPENDING))) {
+ __u64 start = 0;
+ __u64 end = OBD_OBJECT_EOF;
+
rc = lu_env_init(&env, LCT_DT_THREAD);
if (unlikely(rc != 0))
RETURN(rc);
if (!dt_object_exists(obj))
GOTO(err_put, rc = -ENOENT);
- rc = tgt_sync(&env, tgt, obj);
+ if (lock->l_resource->lr_type == LDLM_EXTENT) {
+ start = lock->l_policy_data.l_extent.start;
+ end = lock->l_policy_data.l_extent.end;
+ }
+
+ rc = tgt_sync(&env, tgt, obj, start, end);
if (rc < 0) {
CERROR("%s: syncing "DFID" ("LPU64"-"LPU64") on lock "
"cancel: rc = %d\n",
}
}
- bufsize = 4;
+ bufsize = sizeof(cksum);
err = cfs_crypto_hash_final(hdesc, (unsigned char *)&cksum, &bufsize);
- if (err)
- cfs_crypto_hash_final(hdesc, NULL, NULL);
return cksum;
}