[LU-16411] convert scrub irreparable list to rhashtable Created: 17/Dec/22  Updated: 22/Dec/22

Status: Open
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Xing Huang Assignee: WC Triage
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Related
is related to LU-15643 do not loop on OI Scrub on same FID Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

As Andreas mentioned about the following code in osd_handler.c of https://review.whamcloud.com/46852:
Does it make sense to add a counter here and print a warning if the list is too long (eg. over 5000 items?) so that we know if this needs to be converted to a hash instead of a list?

/**
 * Is object in scrub inconsistent/stale list.
 *
 * \a scrub has two lists, os_inconsistent_items contains mappings to fix, while
 * os_stale_items contains mappings failed to fix.
 */
static bool fid_in_scrub_list(struct lustre_scrub *scrub,
			      const struct list_head *list,
			      const struct lu_fid *fid)
{
	struct osd_inconsistent_item *oii;

	if (list_empty(list))
		return false;

	spin_lock(&scrub->os_lock);
	list_for_each_entry(oii, list, oii_list) {
		if (lu_fid_eq(fid, &oii->oii_cache.oic_fid)) {
			spin_unlock(&scrub->os_lock);
			return true;
		}
	}
	spin_unlock(&scrub->os_lock);

	return false;
}

Generated at Sat Feb 10 03:26:47 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.