}
}
- if (unlikely(!dt_try_as_dir(env, parent)))
+ if (unlikely(!dt_try_as_dir(env, parent, true)))
GOTO(unlock, rc = -ENOTDIR);
th = lfsck_trans_create(env, dev, lfsck);
if (IS_ERR(parent))
GOTO(log, rc = PTR_ERR(parent));
- if (unlikely(!dt_try_as_dir(env, parent)))
+ if (unlikely(!dt_try_as_dir(env, parent, true)))
GOTO(log, rc = -ENOTDIR);
} else {
if (unlikely(lfsck->li_lpf_obj == NULL))
if (rc != 0)
GOTO(stop, rc);
- if (unlikely(!dt_try_as_dir(env, orphan)))
+ if (unlikely(!dt_try_as_dir(env, orphan, false)))
GOTO(stop, rc = -ENOTDIR);
rc = dt_declare_ref_add(env, orphan, th);
if (IS_ERR(parent))
GOTO(log, rc = PTR_ERR(parent));
- if (unlikely(!dt_try_as_dir(env, parent)))
+ if (unlikely(!dt_try_as_dir(env, parent, true)))
GOTO(log, rc = -ENOTDIR);
rc = lfsck_lock(env, lfsck, parent, name, pllh,
if (IS_ERR(parent))
GOTO(log, rc = PTR_ERR(parent));
- if (unlikely(!dt_try_as_dir(env, parent)))
+ if (unlikely(!dt_try_as_dir(env, parent, true)))
GOTO(log, rc = -ENOTDIR);
if (!update || strcmp(name, name2) == 0)
} /* !dt_object_exists(parent) */
/* The unique linkEA entry with bad parent will be handled as orphan. */
- if (unlikely(!dt_try_as_dir(env, parent))) {
+ if (unlikely(!dt_try_as_dir(env, parent, true))) {
if (!lustre_handle_is_used(lh) && retry != NULL)
*retry = true;
else
}
/* The linkEA entry with bad parent will be removed. */
- if (unlikely(!dt_try_as_dir(env, parent))) {
+ if (unlikely(!dt_try_as_dir(env, parent, true))) {
lfsck_object_put(env, parent);
lfsck_linkea_del_buf(ldata, cname);
continue;
RETURN(0);
}
- if (unlikely(!dt_try_as_dir(env, child)))
+ if (unlikely(!dt_try_as_dir(env, child, true)))
GOTO(out, rc = -ENOTDIR);
/* We only take ldlm lock on the @child when required. When the
} /* !dt_object_exists(parent) */
/* The linkEA entry with bad parent will be removed. */
- if (unlikely(!dt_try_as_dir(env, parent))) {
+ if (unlikely(!dt_try_as_dir(env, parent, true))) {
lfsck_object_put(env, parent);
rc = lfsck_namespace_shrink_linkea(env, com, child,
&ldata, cname, pfid, true);
if (IS_ERR(root))
GOTO(log, rc = PTR_ERR(root));
- if (unlikely(!dt_try_as_dir(env, root)))
+ if (unlikely(!dt_try_as_dir(env, root, true)))
GOTO(put, rc = -ENOTDIR);
down_write(&com->lc_sem);
if (IS_ERR(parent))
GOTO(log, rc = PTR_ERR(parent));
- if (unlikely(!dt_try_as_dir(env, parent)))
+ if (unlikely(!dt_try_as_dir(env, parent, true)))
GOTO(log, rc = -ENOTDIR);
child = lfsck_object_locate(dev, child);
GOTO(stop, rc);
if (S_ISDIR(type)) {
- if (unlikely(!dt_try_as_dir(env, child)))
+ if (unlikely(!dt_try_as_dir(env, child, false)))
GOTO(stop, rc = -ENOTDIR);
/* 2a. increase child nlink */
if (!dt_object_exists(parent))
GOTO(out, rc = 0);
- if (unlikely(!dt_try_as_dir(env, parent)))
+ if (unlikely(!dt_try_as_dir(env, parent, true)))
GOTO(out, rc = -ENOTDIR);
CDEBUG(D_LFSCK, "%s: start to scan backend /lost+found\n",
if (IS_ERR(root))
GOTO(out, rc = PTR_ERR(root));
- if (unlikely(!dt_try_as_dir(env, root)))
+ if (unlikely(!dt_try_as_dir(env, root, true)))
GOTO(out, rc = -ENOTDIR);
obj = local_index_find_or_create(env, lfsck->li_los, root,