RETURN(rc);
}
- if (o->opo_new)
- /* no need in logging for new objects being created */
- RETURN(0);
-
if (!(attr->la_valid & (LA_UID | LA_GID)))
RETURN(0);
- if (!is_only_remote_trans(th))
+ if (!is_only_remote_trans(th)) {
+ if (o->opo_new)
+ /* no need in logging for new objects being created */
+ RETURN(0);
+
/*
* track all UID/GID changes via llog
*/
rc = osp_sync_declare_add(env, o, MDS_SETATTR64_REC, th);
- else
+ } else {
/* It is for OST-object attr_set directly without updating
* local MDT-object attribute. It is usually used by LFSCK. */
- rc = osp_md_declare_attr_set(env, dt, attr, th);
+ rc = __osp_md_attr_set(env, dt, attr, th);
+ }
if (rc != 0 || o->opo_ooa == NULL)
RETURN(rc);
if (is_only_remote_trans(th)) {
rc = __osp_attr_set(env, dt, attr, th);
- if (rc != 0)
- RETURN(rc);
+ if (rc == 0 && o->opo_new)
+ o->opo_new = 0;
+
+ RETURN(rc);
}
/* we're interested in uid/gid changes only */
RETURN(0);
}
- if (!is_only_remote_trans(th))
- /*
- * once transaction is committed put proper command on
- * the queue going to our OST
- */
- rc = osp_sync_add(env, o, MDS_SETATTR64_REC, th, attr);
- /* XXX: send new uid/gid to OST ASAP? */
- else
- /* It is for OST-object attr_set directly without updating
- * local MDT-object attribute. It is usually used by LFSCK. */
- rc = osp_md_attr_set(env, dt, attr, th, capa);
+ rc = osp_sync_add(env, o, MDS_SETATTR64_REC, th, attr);
+ /* XXX: send new uid/gid to OST ASAP? */
RETURN(rc);
}
LASSERT(name != NULL);
if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_BAD_NETWORK) &&
- osp->opd_index == cfs_fail_val &&
- osp_dev2node(osp) == cfs_fail_val)
- RETURN(-ENOTCONN);
+ osp->opd_index == cfs_fail_val) {
+ if (is_ost_obj(&dt->do_lu)) {
+ if (osp_dev2node(osp) == cfs_fail_val)
+ RETURN(-ENOTCONN);
+ } else {
+ if (strcmp(name, XATTR_NAME_LINK) == 0)
+ RETURN(-ENOTCONN);
+ }
+ }
if (unlikely(obj->opo_non_exist))
RETURN(-ENOENT);
it->ooi_pos_ent = -1;
it->ooi_obj = dt;
+ it->ooi_attr = attr;
return (struct dt_it *)it;
}
ii->ii_fid.f_oid = osp->opd_index;
ii->ii_fid.f_ver = 0;
ii->ii_flags = II_FL_NOHASH;
+ ii->ii_attrs = osp_dev2node(osp);
} else {
ii->ii_fid = *lu_object_fid(&it->ooi_obj->do_lu);
ii->ii_flags = II_FL_NOHASH | II_FL_NOKEY | II_FL_VARKEY |
II_FL_VARREC;
+ ii->ii_attrs = it->ooi_attr;
}
ii->ii_magic = IDX_INFO_MAGIC;
ii->ii_count = npages * LU_PAGE_COUNT;
ii->ii_hash_start = it->ooi_next;
- ii->ii_attrs = osp_dev2node(osp);
ptlrpc_at_set_req_timeout(req);
* \param[in] env pointer to the thread context
* \param[in] di pointer to the iteration structure
*
+ * \retval positive for end of the directory
* \retval 0 for success
* \retval negative error number on failure
*/
}
it->ooi_cur_idxpage = NULL;
it->ooi_pos_lu_page++;
+
again1:
if (it->ooi_pos_lu_page < LU_PAGE_COUNT) {
it->ooi_cur_idxpage = (void *)it->ooi_cur_page +
* \param[in] env pointer to the thread context
* \param[in] di pointer to the iteration structure
*
+ * \retval positive for end of the directory
* \retval 0 for success
* \retval negative error number on failure
*/