if (th != NULL && !IS_ERR(th))
dt_trans_stop(env, dev, th);
- CDEBUG(D_LFSCK, "%s: namespace LFSCK %s flags for "DFID" in the "
+ CDEBUG(rc ? D_LFSCK : D_INFO,
+ "%s: namespace LFSCK %s flags for "DFID" in the "
"trace file, flags %x, old %x, new %x: rc = %d\n",
lfsck_lfsck2name(lfsck), add ? "add" : "del", PFID(fid),
(__u32)flags, (__u32)old, (__u32)new, rc);
int rc = 0;
ENTRY;
- CDEBUG(D_LFSCK, "%s: record slave LMV EA for the striped directory "
+ CDEBUG(D_INFO, "%s: record slave LMV EA for the striped directory "
DFID": shard = "DFID", index = %u, flags = %u, flags2 = %u, "
"depth = %d\n", lfsck_lfsck2name(lfsck),
PFID(lfsck_dto2fid(dir)), PFID(fid),
struct osd_thread_info *oti = oclb->oclb_info;
struct lu_fid *fid = &oti->oti_fid3;
struct osd_inode_id *id = &oti->oti_id3;
+ struct osd_inode_id id2;
struct osd_device *dev = oclb->oclb_dev;
struct inode *inode;
iput(inode);
osd_add_oi_cache(oti, dev, id, fid);
- osd_scrub_oi_insert(dev, fid, id, true);
+ /* Check shard by scrub only if it has a problem with OI */
+ if (osd_oi_lookup(oti, dev, fid, &id2, 0) || !osd_id_eq(id, &id2))
+ osd_scrub_oi_insert(dev, fid, id, true);
oclb->oclb_found = true;
return 1;
osd_dto_credits_noquota[DTO_INDEX_INSERT]);
if (IS_ERR(th)) {
rc = PTR_ERR(th);
- CDEBUG(D_LFSCK, "%s: fail to start trans for scrub op %d "
- DFID" => %u/%u: rc = %d\n", osd_name(dev), ops,
- PFID(fid), id ? id->oii_ino : -1, id ? id->oii_gen : -1,
- rc);
+ CWARN("%s: fail to start trans for scrub op %d "
+ DFID" => %u/%u: rc = %d\n", osd_name(dev), ops,
+ PFID(fid), id ? id->oii_ino : -1, id ? id->oii_gen : -1,
+ rc);
RETURN(rc);
}
scrub->os_pos_current = ooc->ooc_pos_preload;
}
- CDEBUG(D_LFSCK, "%s: OI scrub start, flags = 0x%x, pos = %llu\n",
+ CDEBUG(D_LFSCK, "%s: OI scrub start, flags = 0x%x, pos = %llu%s\n",
osd_scrub2name(scrub), scrub->os_start_flags,
- scrub->os_pos_current);
+ scrub->os_pos_current,
+ scrub->os_file.sf_param & SP_DRYRUN ? " dryrun mode" : "");
rc = osd_inode_iteration(osd_oti_get(&env), dev, ~0U, false);
if (unlikely(rc == SCRUB_IT_CRASH)) {
dev->od_check_ff = 0;
}
rc = scrub_thread_post(&env, &dev->od_scrub.os_scrub, rc);
- CDEBUG(D_LFSCK, "%s: OI scrub: stop, pos = %llu: rc = %d\n",
- osd_scrub2name(scrub), scrub->os_pos_current, rc);
+ CDEBUG(D_LFSCK, "%s: OI scrub: stop, pos = %llu: rc = %d%s\n",
+ osd_scrub2name(scrub), scrub->os_pos_current, rc,
+ scrub->os_file.sf_param & SP_DRYRUN ? " dryrun mode" : "");
+
out:
osd_scrub_ois_fini(scrub, &scrub->os_inconsistent_items);