GOTO(log, rc = 1);
if (dt_object_remote(orphan)) {
- LASSERT(lfsck->li_lpf_root_obj != NULL);
+ if (lfsck->li_lpf_root_obj == NULL)
+ GOTO(log, rc = -EBADF);
idx = lfsck_find_mdt_idx_by_fid(env, lfsck, cfid);
if (idx < 0)
if (lfsck->li_bookmark_ram.lb_param & LPF_DRYRUN)
GOTO(unlock, rc = 1);
- /* If all known entries are in the linkEA, then the 'leh_reccount'
- * should NOT be zero. */
- LASSERT(ldata->ld_leh->leh_reccount > 0);
-
lfsck_buf_init(&linkea_buf, ldata->ld_buf->lb_buf,
ldata->ld_leh->leh_len);
rc = dt_xattr_set(env, obj, &linkea_buf, XATTR_NAME_LINK, 0, th);
repaired = true;
- /* fall through */
+ /* fallthrough */
}
parent = lfsck_object_find_bottom(env, lfsck, pfid);
int rc = 0;
__u8 flags = 0;
bool exist = false;
+
ENTRY;
child = lfsck_object_find_by_dev(env, dev, &ent->lde_fid);
if (IS_ERR(child))
RETURN(PTR_ERR(child));
- LASSERT(dt_object_exists(child));
+ if (!dt_object_exists(child)) {
+ CDEBUG(D_LFSCK, "%s: lost+found/%s doesn't exist\n",
+ lfsck_lfsck2name(lfsck), ent->lde_name);
+ GOTO(out, rc = -ENOENT);
+ }
+
LASSERT(!dt_object_remote(child));
idx = lfsck_sub_trace_file_fid2idx(&ent->lde_fid);
int rc;
int fl = LU_XATTR_CREATE;
bool dirty = false;
+
ENTRY;
- LASSERT(S_ISDIR(lfsck_object_type(obj)));
+ if (!dt_object_exists(obj))
+ RETURN(-ENOENT);
+
+ if (!S_ISDIR(lfsck_object_type(obj)))
+ RETURN(-ENOTDIR);
rc = lfsck_links_read_with_rec(env, obj, &ldata);
if (rc == -ENODATA) {
default:
CERROR("%s: unknown lfsck_namespace status %d\n",
lfsck_lfsck2name(lfsck), ns->ln_status);
- /* fall through */
+ fallthrough;
case LS_SCANNING_PHASE1:
case LS_SCANNING_PHASE2:
/* No need to store the status to disk right now.
* If the system crashed before the status stored,
* it will be loaded back when next time. */
ns->ln_status = LS_CRASHED;
- /* fall through */
+ fallthrough;
case LS_PAUSED:
case LS_CRASHED:
spin_lock(&lfsck->li_lock);