struct lfsck_assistant_req *lar)
{
struct lfsck_namespace_req *lnr =
- container_of0(lar, struct lfsck_namespace_req, lnr_lar);
+ container_of(lar, struct lfsck_namespace_req, lnr_lar);
if (lnr->lnr_lmv != NULL)
lfsck_lmv_put(env, lnr->lnr_lmv);
if (IS_ERR(th))
RETURN(PTR_ERR(th));
- rc = dt_declare_xattr_set(env, obj, &buf, XATTR_NAME_LMV".set", 0, th);
+ rc = dt_declare_xattr_set(env, obj, &buf, XATTR_NAME_LMV, 0, th);
if (rc)
GOTO(stop, rc);
if (rc != 0)
GOTO(stop, rc);
- rc = dt_xattr_set(env, obj, &buf, XATTR_NAME_LMV".set", 0, th);
+ rc = dt_xattr_set(env, obj, &buf, XATTR_NAME_LMV, 0, th);
if (rc)
GOTO(stop, rc);
}
if (parent_lmv_lost) {
- rc = dt_declare_xattr_set(env, parent, &buf,
- XATTR_NAME_LMV".set", 0, th);
+ rc = dt_declare_xattr_set(env, parent, &buf, XATTR_NAME_LMV,
+ 0, th);
if (rc)
GOTO(stop, rc);
}
}
if (parent_lmv_lost) {
- rc = dt_xattr_set(env, parent, &buf, XATTR_NAME_LMV".set", 0,
- th);
+ rc = dt_xattr_set(env, parent, &buf, XATTR_NAME_LMV, 0, th);
if (rc)
GOTO(stop, rc);
}
lmv->lmv_master_mdt_index = lfsck_dev_idx(lfsck);
lfsck_lmv_header_cpu_to_le(lmv2, lmv);
lfsck_buf_init(&lmv_buf, lmv2, sizeof(*lmv2));
- rc = dt_declare_xattr_set(env, orphan, &lmv_buf,
- XATTR_NAME_LMV, 0, th);
+ rc = dt_declare_xattr_set(env, orphan, &lmv_buf, XATTR_NAME_LMV,
+ 0, th);
if (rc != 0)
GOTO(stop, rc);
}
dt_write_lock(env, parent, 0);
- rc = dt_lookup(env, parent, (struct dt_rec *)&tfid,
+ rc = dt_lookup(env, dt_object_child(parent), (struct dt_rec *)&tfid,
(const struct dt_key *)name);
/* Someone has removed the bad name entry by race. */
if (rc == -ENOENT)
if (flags & (LNTF_CHECK_LINKEA | LNTF_CHECK_PARENT) &&
!(lfsck->li_bookmark_ram.lb_param & LPF_ALL_TGT)) {
- CDEBUG(D_LFSCK, "%s: some MDT(s) maybe NOT take part in the"
- "the namespace LFSCK, then the LFSCK cannot guarantee"
- "all the name entries have been verified in first-stage"
- "scanning. So have to skip orphan related handling for"
- "the directory object "DFID" with remote name entry\n",
+ CDEBUG(D_LFSCK,
+ "%s: some MDT(s) maybe NOT take part in the the namespace LFSCK, then the LFSCK cannot guarantee all the name entries have been verified in first-stage scanning. So have to skip orphan related handling for the directory object "DFID" with remote name entry\n",
lfsck_lfsck2name(lfsck), PFID(cfid));
RETURN(0);
*/
if (S_ISREG(type))
child->do_ops->do_ah_init(env, hint, parent, child, type);
+ else if (S_ISDIR(type))
+ child->do_ops->do_ah_init(env, hint, NULL, child, type);
memset(dof, 0, sizeof(*dof));
dof->dof_type = dt_mode_to_dft(type);
lfsck_lmv_header_cpu_to_le(lmv2, lmv2);
lfsck_buf_init(&lmv_buf, lmv2, sizeof(*lmv2));
rc = dt_declare_xattr_set(env, child, &lmv_buf,
- XATTR_NAME_LMV".set", 0, th);
+ XATTR_NAME_LMV, 0, th);
if (rc != 0)
GOTO(stop, rc);
}
/* 5b. generate slave LMV EA. */
if (lnr->lnr_lmv != NULL && lnr->lnr_lmv->ll_lmv_master) {
- rc = dt_xattr_set(env, child, &lmv_buf,
- XATTR_NAME_LMV".set", 0, th);
+ rc = dt_xattr_set(env, child, &lmv_buf, XATTR_NAME_LMV,
+ 0, th);
if (rc != 0)
GOTO(unlock, rc);
}
const struct lu_name *cname;
struct thandle *handle = NULL;
struct lfsck_namespace_req *lnr =
- container_of0(lar, struct lfsck_namespace_req, lnr_lar);
+ container_of(lar, struct lfsck_namespace_req, lnr_lar);
struct dt_object *dir = NULL;
struct dt_object *obj = NULL;
struct lfsck_assistant_object *lso = lar->lar_parent;
repaired = true;
}
- if (unlikely(fid_is_zero(&lnr->lnr_fid))) {
- if (strcmp(lnr->lnr_name, dotdot) != 0)
- LBUG();
- else
- rc = lfsck_namespace_trace_update(env, com, pfid,
+ if (unlikely(fid_is_zero(&lnr->lnr_fid) &&
+ strcmp(lnr->lnr_name, dotdot) == 0)) {
+ rc = lfsck_namespace_trace_update(env, com, pfid,
LNTF_CHECK_PARENT, true);
GOTO(out, rc);