* can be called with local object existing
*/
if (!dt_object_exists(nextc) || dt_object_remote(nextc))
- nextc->do_ops->do_ah_init(env, ah, nextp, nextc, child_mode);
+ nextc->do_ops->do_ah_init(env, ah, dt_object_remote(nextp) ?
+ NULL : nextp, nextc, child_mode);
if (S_ISDIR(child_mode)) {
if (lp->ldo_striping_cached == 0) {
if (rc < 0)
GOTO(out_los, rc);
+ lu_root_fid(&fid);
if (mdd_seq_site(mdd)->ss_node_id == 0) {
- lu_root_fid(&fid);
rc = mdd_local_file_create(env, mdd, &mdd->mdd_local_root_fid,
mdd_root_dir_name, S_IFDIR |
S_IRUGO | S_IWUSR | S_IXUGO, &fid);
mdd2obd_dev(mdd)->obd_name, rc);
GOTO(out_los, rc);
}
- mdd->mdd_root_fid = fid;
+ mdd->mdd_root_fid = fid;
rc = mdd_dot_lustre_setup(env, mdd);
if (rc != 0) {
CERROR("%s: initializing .lustre failed: rc = %d\n",
if (rc)
GOTO(out_los, rc);
+ } else {
+ /* Normal client usually send root access to MDT0 directly,
+ * the root FID on non-MDT0 will only be used by echo client. */
+ mdd->mdd_root_fid = fid;
}
rc = orph_index_init(env, mdd);
}
if (!(spec->sp_cr_flags & MDS_OPEN_VOLATILE)) {
- rc = mdo_declare_attr_set(env, p, attr, handle);
+ struct lu_attr *la = &mdd_env_info(env)->mti_la_for_fix;
+
+ *la = *attr;
+ la->la_valid = LA_CTIME | LA_MTIME;
+ rc = mdo_declare_attr_set(env, p, la, handle);
if (rc)
return rc;
}
GOTO(out_put, rc = -EINVAL);
}
+ if (lu_object_remote(child)) {
+ CERROR("Can not destroy remote object %s: rc = %d\n",
+ lname->ln_name, -EPERM);
+ GOTO(out_put, rc = -EPERM);
+ }
CDEBUG(D_RPCTRACE, "Start destroy object "DFID" %s %p\n",
PFID(lu_object_fid(&parent->mo_lu)), lname->ln_name, parent);
count = data->ioc_count;
cmd = data->ioc_command;
- id = ostid_id(&data->ioc_obdo2.o_oi);
-
+ id = data->ioc_obdo2.o_oi.oi.oi_id;
dirlen = data->ioc_plen1;
OBD_ALLOC(dir, dirlen + 1);
if (dir == NULL)
}
rc = osp_remote_sync(env, dt_dev, update, &req);
- if (rc < 0) {
- CERROR("%s: lookup "DFID" %s failed: rc = %d\n",
- dt_dev->dd_lu_dev.ld_obd->obd_name,
- PFID(lu_object_fid(&dt->do_lu)), (char *)key, rc);
+ if (rc < 0)
GOTO(out, rc);
- }
reply = req_capsule_server_sized_get(&req->rq_pill, &RMF_UPDATE_REPLY,
UPDATE_BUFFER_SIZE);
struct lu_fid fid = { 0 };
if (child_base_id != -1)
- ostid_set_id(&data.ioc_obdo2.o_oi, child_base_id);
-
+ data.ioc_obdo2.o_oi.oi.oi_id = child_base_id;
data.ioc_obdo2.o_mode = mode | create_mode;
data.ioc_obdo2.o_valid = OBD_MD_FLID | OBD_MD_FLTYPE |
OBD_MD_FLMODE | OBD_MD_FLFLAGS |