void scrub_file_reset(struct lustre_scrub *scrub, guid_t uuid, u64 flags)
{
struct scrub_file *sf = &scrub->os_file;
+ ENTRY;
CDEBUG(D_LFSCK, "%s: reset OI scrub file, old flags = "
"%#llx, add flags = %#llx\n",
sf->sf_items_igif = 0;
if (!scrub->os_in_join)
sf->sf_items_updated_prior = 0;
+ EXIT;
}
EXPORT_SYMBOL(scrub_file_reset);
if (rc == -ENOENT && create == false) {
if (oi_count == 0)
- return count;
+ RETURN(count);
rc = 0;
ldiskfs_set_bit(i, sf->sf_oi_bitmap);
if (count == sf->sf_oi_count)
GOTO(out, rc = count);
- if (sf->sf_oi_count == 0) {
- if (likely((count & (count - 1)) == 0))
- GOTO(out, rc = count);
-
- LCONSOLE_WARN(
- "%s: invalid oi count %d, remove them, then set it to %d\n",
+ /* Trust the counted number of OI files if it is sane */
+ if ((count & (count - 1)) != 0) {
+ LCONSOLE_WARN("%s: invalid oi count %d, remove them, then set it to %d\n",
osd_dev2name(osd), count, osd_oi_count);
osd_oi_table_put(info, oi, count);
rc = osd_remove_ois(info, osd);
if (rc)
GOTO(out, rc);
- sf->sf_oi_count = osd_oi_count;
+ count = osd_oi_count;
}
scrub_file_reset(scrub, osd->od_uuid, SF_RECREATED);
- count = sf->sf_oi_count;
+ sf->sf_oi_count = count;
goto create;
}