struct lfsck_thread_info *info = lfsck_env_info(env);
struct lu_attr *la = &info->lti_la;
struct lfsck_instance *lfsck = com->lc_lfsck;
- struct dt_device *dev = lfsck_obj2dt_dev(obj);
+ struct dt_device *dev = lfsck_obj2dev(obj);
struct thandle *th = NULL;
int rc = 0;
ENTRY;
GOTO(unlock, rc = 0);
if (del_lmv) {
- rc = dt_xattr_del(env, obj, XATTR_NAME_LMV, th, BYPASS_CAPA);
+ rc = dt_xattr_del(env, obj, XATTR_NAME_LMV, th);
if (rc != 0)
GOTO(unlock, rc);
}
- rc = dt_attr_get(env, obj, la, BYPASS_CAPA);
+ rc = dt_attr_get(env, obj, la);
if (rc == 0 && !(la->la_flags & LUSTRE_IMMUTABLE_FL)) {
la->la_valid = LA_FLAGS;
la->la_flags |= LUSTRE_IMMUTABLE_FL;
- rc = dt_attr_set(env, obj, la, th, BYPASS_CAPA);
+ rc = dt_attr_set(env, obj, la, th);
}
GOTO(unlock, rc);
snprintf(info->lti_tmpbuf2, sizeof(info->lti_tmpbuf2), DFID":%u",
PFID(fid), index);
- obj = lfsck_object_find_by_dev(env, com->lc_lfsck->li_bottom, fid);
+ obj = lfsck_object_find_bottom(env, com->lc_lfsck, fid);
if (IS_ERR(obj))
return PTR_ERR(obj);
int lfsck_read_stripe_lmv(const struct lu_env *env, struct dt_object *obj,
struct lmv_mds_md_v1 *lmv)
{
- struct dt_object *bottom;
- int rc;
+ int rc;
- /* Currently, we only store the LMV header on disk. It is the LOD's
- * duty to iterate the master MDT-object's directory to compose the
- * integrated LMV EA. But here, we only want to load the LMV header,
- * so we need to bypass LOD to avoid unnecessary iteration in LOD. */
- bottom = lu2dt(container_of0(obj->do_lu.lo_header->loh_layers.prev,
- struct lu_object, lo_linkage));
- if (unlikely(bottom == NULL))
- return -ENOENT;
-
- dt_read_lock(env, bottom, 0);
- rc = dt_xattr_get(env, bottom, lfsck_buf_get(env, lmv, sizeof(*lmv)),
- XATTR_NAME_LMV, BYPASS_CAPA);
- dt_read_unlock(env, bottom);
+ dt_read_lock(env, obj, 0);
+ rc = dt_xattr_get(env, obj, lfsck_buf_get(env, lmv, sizeof(*lmv)),
+ XATTR_NAME_LMV);
+ dt_read_unlock(env, obj);
if (rc != sizeof(*lmv))
return rc > 0 ? -EINVAL : rc;
struct lmv_mds_md_v1 *lmv4 = &info->lti_lmv4;
struct lu_buf *buf = &info->lti_buf;
struct lfsck_instance *lfsck = com->lc_lfsck;
- struct dt_device *dev = lfsck_obj2dt_dev(obj);
+ struct dt_device *dev = lfsck_obj2dev(obj);
struct thandle *th = NULL;
struct lustre_handle lh = { 0 };
int rc = 0;
if (lfsck->li_bookmark_ram.lb_param & LPF_DRYRUN)
GOTO(unlock, rc = 0);
- rc = dt_xattr_set(env, obj, buf, XATTR_NAME_LMV, 0, th, BYPASS_CAPA);
+ rc = dt_xattr_set(env, obj, buf, XATTR_NAME_LMV, 0, th);
GOTO(unlock, rc);
snprintf(info->lti_tmpbuf, sizeof(info->lti_tmpbuf), DFID":%u",
PFID(cfid), cidx);
rc = dt_lookup(env, obj, (struct dt_rec *)tfid,
- (const struct dt_key *)info->lti_tmpbuf, BYPASS_CAPA);
+ (const struct dt_key *)info->lti_tmpbuf);
if (rc != 0)
RETURN(rc);
args = lfsck->li_args_dir & ~(LUDA_VERIFY | LUDA_VERIFY_DRYRUN);
iops = &obj->do_index_ops->dio_it;
- di = iops->init(env, obj, args, BYPASS_CAPA);
+ di = iops->init(env, obj, args);
if (IS_ERR(di))
RETURN(PTR_ERR(di));
lr = req_capsule_client_get(&req->rq_pill, &RMF_LFSCK_REQUEST);
memset(lr, 0, sizeof(*lr));
lr->lr_event = event;
- lr->lr_index = lfsck_dev_idx(lfsck->li_bottom);
+ lr->lr_index = lfsck_dev_idx(lfsck);
lr->lr_active = LFSCK_TYPE_NAMESPACE;
lr->lr_fid = *fid;
lr->lr_flags = flags;
*
* \param[in] env pointer to the thread context
* \param[in] com pointer to the lfsck component
- * \param[in] dir pointer to the object on which the LMV EA will be set
+ * \param[in] obj pointer to the object on which the LMV EA will be set
* \param[in] lmv pointer to the buffer holding the new LMV EA
* \param[in] cfid the shard's FID used for verification
* \param[in] cidx the shard's index used for verification
*/
static int lfsck_namespace_set_lmv_master(const struct lu_env *env,
struct lfsck_component *com,
- struct dt_object *dir,
+ struct dt_object *obj,
struct lmv_mds_md_v1 *lmv,
const struct lu_fid *cfid,
__u32 cidx, __u32 flags)
struct lmv_mds_md_v1 *lmv3 = &info->lti_lmv3;
struct lu_seq_range *range = &info->lti_range;
struct lfsck_instance *lfsck = com->lc_lfsck;
- struct seq_server_site *ss =
- lu_site2seq(lfsck->li_bottom->dd_lu_dev.ld_site);
- struct dt_object *obj;
+ struct seq_server_site *ss = lfsck_dev_site(lfsck);
struct lustre_handle lh = { 0 };
int pidx = -1;
int rc = 0;
ENTRY;
- /* Find the bottom object to bypass LOD when set LMV EA. */
- obj = lu2dt(container_of0(dir->do_lu.lo_header->loh_layers.prev,
- struct lu_object, lo_linkage));
- if (unlikely(obj == NULL))
- RETURN(-ENOENT);
-
fld_range_set_mdt(range);
rc = fld_server_lookup(env, ss->ss_server_fld,
fid_seq(lfsck_dto2fid(obj)), range);
ENTRY;
rc = dt_lookup(env, shard, (struct dt_rec *)pfid,
- (const struct dt_key *)dotdot, BYPASS_CAPA);
+ (const struct dt_key *)dotdot);
if (rc != 0 || !fid_is_sane(pfid))
GOTO(log, rc);
CDEBUG(D_LFSCK, "%s: namespace LFSCK assistant found bad name hash "
"on the MDT %x, parent "DFID", name %s, shard_%x "DFID
": rc = %d\n",
- lfsck_lfsck2name(lfsck), lfsck_dev_idx(lfsck->li_bottom),
+ lfsck_lfsck2name(lfsck), lfsck_dev_idx(lfsck),
PFID(pfid), name, llmv->ll_lmv.lmv_master_mdt_index,
PFID(lfsck_dto2fid(shard)), rc);
args = lfsck->li_args_dir & ~(LUDA_VERIFY | LUDA_VERIFY_DRYRUN);
iops = &child->do_index_ops->dio_it;
- di = iops->init(env, child, args, BYPASS_CAPA);
+ di = iops->init(env, child, args);
if (IS_ERR(di))
GOTO(out, rc = PTR_ERR(di));
}
rc = dt_lookup(env, obj, (struct dt_rec *)pfid,
- (const struct dt_key *)dotdot, BYPASS_CAPA);
+ (const struct dt_key *)dotdot);
if (rc != 0 || !fid_is_sane(pfid)) {
rc = lfsck_namespace_trace_update(env, com, cfid,
LNTF_UNCERTAIN_LMV, true);
GOTO(out, rc);
}
- parent = lfsck_object_find(env, lfsck, pfid);
+ parent = lfsck_object_find_bottom(env, lfsck, pfid);
if (IS_ERR(parent)) {
rc = lfsck_namespace_trace_update(env, com, cfid,
LNTF_UNCERTAIN_LMV, true);
}
rc = dt_lookup(env, parent, (struct dt_rec *)&tfid,
- (const struct dt_key *)name2, BYPASS_CAPA);
+ (const struct dt_key *)name2);
if (rc != 0 || !lu_fid_eq(cfid, &tfid))
rc = lfsck_namespace_trace_update(env, com, cfid,
LNTF_UNCERTAIN_LMV, true);
struct lmv_mds_md_v1 *lmv2 = &info->lti_lmv2;
const struct lu_fid *pfid = lfsck_dto2fid(dir);
struct lu_seq_range *range = &info->lti_range;
- struct seq_server_site *ss =
- lu_site2seq(lfsck->li_bottom->dd_lu_dev.ld_site);
+ struct seq_server_site *ss = lfsck_dev_site(lfsck);
__u32 stripe_count;
__u32 hash_type;
int rc = 0;
rc1 = lfsck_ibits_lock(env, lfsck, obj, &lh,
MDS_INODELOCK_UPDATE |
MDS_INODELOCK_XATTR, LCK_EX);
- lfsck_ibits_unlock(&lh, LCK_EX);
if (rc1 != 0)
goto next;
rc1 = lfsck_namespace_rebuild_linkea(env, com, obj,
&ldata);
+ lfsck_ibits_unlock(&lh, LCK_EX);
if (rc1 >= 0) {
linkea_repaired = true;
if (rc1 > 0)
if (shard_idx < 0)
GOTO(fail_lmv, rc = shard_idx);
- if (shard_idx == lfsck_dev_idx(lfsck->li_bottom)) {
+ if (shard_idx == lfsck_dev_idx(lfsck)) {
if (unlikely(strcmp(lnr->lnr_name, dotdot) == 0))
GOTO(out, rc = 0);
- dev = lfsck->li_next;
+ dev = lfsck->li_bottom;
} else {
struct lfsck_tgt_desc *ltd;
if ((rc == -ENOTCONN || rc == -ESHUTDOWN || rc == -EREMCHG ||
rc == -ETIMEDOUT || rc == -EHOSTDOWN ||
rc == -EHOSTUNREACH || rc == -EINPROGRESS) &&
- dev != NULL && dev != lfsck->li_next)
+ dev != NULL && dev != lfsck->li_bottom)
lfsck_lad_set_bitmap(env, com, shard_idx);
if (!(lfsck->li_bookmark_ram.lb_param & LPF_FAILOUT))