* trace file
* \param[in] add true if add new flags, otherwise remove flags
*
- * \retval 0 for succeed or nothing to be done
+ * \retval 0 for success or nothing to be done
* \retval negative error number on failure
*/
int lfsck_namespace_trace_update(const struct lu_env *env,
"entry for: parent "DFID", child "DFID", name %s, type "
"in name entry %o, type claimed by child %o. repair it "
"by %s with new name2 %s: rc = %d\n", lfsck_lfsck2name(lfsck),
- PFID(lfsck_dto2fid(parent)), PFID(lfsck_dto2fid(child)),
+ PFID(lfsck_dto2fid(parent)), PFID(cfid),
name, type, update ? lfsck_object_type(child) : 0,
update ? "updating" : "removing", name2, rc);
lfsck_pos_dump(m, &pos, "current_position");
} else if (ns->ln_status == LS_SCANNING_PHASE2) {
cfs_duration_t duration = cfs_time_current() -
- lfsck->li_time_last_checkpoint;
+ com->lc_time_last_checkpoint;
__u64 checked = ns->ln_objs_checked_phase2 +
com->lc_new_checked;
__u64 speed1 = ns->ln_items_checked;
struct lfsck_assistant_data *lad = com->lc_data;
struct lfsck_tgt_descs *ltds = &lfsck->li_mdt_descs;
struct lfsck_tgt_desc *ltd;
- int rc;
+ int rc = 0;
bool fail = false;
ENTRY;
if (IS_ERR(obj))
RETURN(PTR_ERR(obj));
- rc = lfsck_namespace_notify_lmv_master_local(env, com, obj);
+ if (likely(dt_object_exists(obj)))
+ rc = lfsck_namespace_notify_lmv_master_local(env, com,
+ obj);
+
lfsck_object_put(env, obj);
RETURN(rc > 0 ? 0 : rc);
lr->lr_index, lr->lr_status, lr->lr_flags2);
spin_lock(<ds->ltd_lock);
- ltd = LTD_TGT(ltds, lr->lr_index);
+ ltd = lfsck_ltd2tgt(ltds, lr->lr_index);
if (ltd == NULL) {
spin_unlock(<ds->ltd_lock);
"name %s. %s: rc = %d\n", lfsck_lfsck2name(lfsck),
PFID(lfsck_dto2fid(parent)), PFID(lfsck_dto2fid(child)),
type, cname->ln_name,
- create ? "Create the lost OST-object as required" :
+ create ? "Create the lost MDT-object as required" :
"Keep the MDT-object there by default", rc);
if (rc <= 0) {
struct lfsck_instance *lfsck = com->lc_lfsck;
struct lfsck_bookmark *bk = &lfsck->li_bookmark_ram;
struct lfsck_namespace *ns = com->lc_file_ram;
+ struct lfsck_assistant_data *lad = com->lc_data;
struct linkea_data ldata = { NULL };
const struct lu_name *cname;
struct thandle *handle = NULL;
bool newdata;
bool log = false;
bool bad_hash = false;
+ bool bad_linkea = false;
int idx = 0;
int count = 0;
int rc = 0;
GOTO(out, rc);
}
- ltd = LTD_TGT(&lfsck->li_mdt_descs, idx);
+ ltd = lfsck_ltd2tgt(&lfsck->li_mdt_descs, idx);
if (unlikely(ltd == NULL)) {
CDEBUG(D_LFSCK, "%s: cannot talk with MDT %x which "
"did not join the namespace LFSCK\n",
GOTO(out, rc);
}
- if (!(bk->lb_param & LPF_DRYRUN) && repaired) {
+ if (!(bk->lb_param & LPF_DRYRUN) && lad->lad_advance_lock) {
again:
rc = lfsck_ibits_lock(env, lfsck, obj, &lh,
if (rc != 0)
GOTO(stop, rc);
+ bad_linkea = true;
if (!remove && newdata)
ns->ln_flags |= LF_UPGRADE;
else if (remove || !(ns->ln_flags & LF_UPGRADE))
rc = lfsck_namespace_repair_bad_name_hash(env, com, dir,
lnr->lnr_lmv, lnr->lnr_name);
- if (rc >= 0)
+ if (rc == 0)
bad_hash = true;
}
if (dir != NULL && !IS_ERR(dir))
lfsck_object_put(env, dir);
+ lad->lad_advance_lock = bad_linkea;
+
return rc;
}
down_write(&com->lc_sem);
ns->ln_run_time_phase2 += cfs_duration_sec(cfs_time_current() +
- HALF_SEC - lfsck->li_time_last_checkpoint);
+ HALF_SEC - com->lc_time_last_checkpoint);
ns->ln_time_last_checkpoint = cfs_time_current_sec();
ns->ln_objs_checked_phase2 += com->lc_new_checked;
com->lc_new_checked = 0;
down_read(<ds->ltd_rw_sem);
cfs_foreach_bit(lad->lad_bitmap, idx) {
- ltd = LTD_TGT(ltds, idx);
+ ltd = lfsck_ltd2tgt(ltds, idx);
LASSERT(ltd != NULL);
laia->laia_ltd = ltd;