sf->sf_items_updated = 0;
sf->sf_items_failed = 0;
sf->sf_items_updated_prior = 0;
+ sf->sf_items_noscrub = 0;
+ sf->sf_items_igif = 0;
}
static int osd_scrub_file_load(struct osd_scrub *scrub)
osd_scrub_file_to_le(&scrub->os_file_disk, &scrub->os_file);
rc = osd_ldiskfs_write_record(scrub->os_inode, &scrub->os_file_disk,
- len, &pos, jh);
+ len, 0, &pos, jh);
ldiskfs_journal_stop(jh);
if (rc != 0)
CERROR("%.16s: fail to store scrub file, expected = %d, "
#define SCRUB_NEXT_WAIT 4 /* wait for free cache slot */
#define SCRUB_NEXT_CRASH 5 /* simulate system crash during OI scrub */
#define SCRUB_NEXT_FATAL 6 /* simulate failure during OI scrub */
+#define SCRUB_NEXT_NOSCRUB 7 /* new created object, no scrub on it */
+#define SCRUB_NEXT_IGIF 8 /* IGIF object */
struct osd_iit_param {
struct super_block *sb;
if (rc != 0)
return rc;
- if (!fid_is_norm(fid) || inode->i_state & I_LUSTRE_NOSCRUB)
- rc = SCRUB_NEXT_CONTINUE;
+ if (inode->i_state & I_LUSTRE_NOSCRUB) {
+ /* Only skip it for the first OI scrub accessing. */
+ inode->i_state &= ~I_LUSTRE_NOSCRUB;
+ rc = SCRUB_NEXT_NOSCRUB;
+ } else if (!fid_is_norm(fid)) {
+ rc = SCRUB_NEXT_IGIF;
+ }
+
iput(inode);
return rc;
}
{
struct l_wait_info lwi = { 0 };
struct osd_scrub *scrub = &dev->od_scrub;
+ struct scrub_file *sf = &scrub->os_file;
+ __u64 *items = NULL;
struct ptlrpc_thread *thread = &scrub->os_thread;
struct osd_otable_it *it = dev->od_otable_it;
struct osd_otable_cache *ooc = it ? &it->ooi_cache : NULL;
goto next;
case SCRUB_NEXT_WAIT:
goto wait;
+ case SCRUB_NEXT_NOSCRUB:
+ items = &sf->sf_items_noscrub;
+ break;
+ case SCRUB_NEXT_IGIF:
+ items = &sf->sf_items_igif;
+ break;
+ }
+
+ if (items != NULL) {
+ cfs_down_write(&scrub->os_rwsem);
+ scrub->os_new_checked++;
+ (*items)++;
+ cfs_up_write(&scrub->os_rwsem);
+ goto next;
}
LASSERTF(rc <= 0, "unexpected rc = %d\n", rc);
"updated: "LPU64"\n"
"failed: "LPU64"\n"
"prior_updated: "LPU64"\n"
+ "noscrub: "LPU64"\n"
+ "igif: "LPU64"\n"
"success_count: %u\n",
checked, sf->sf_items_updated, sf->sf_items_failed,
- sf->sf_items_updated_prior, sf->sf_success_count);
+ sf->sf_items_updated_prior, sf->sf_items_noscrub,
+ sf->sf_items_igif, sf->sf_success_count);
if (rc <= 0)
goto out;