Sometimes, the OI scrub can be triggered as partial mode by
randomly found inconsistent OI mapping(s). Under such case,
if the sysadmin triggers LFSCK/OI scrub (full mode) manually,
the partial mode OI scrub needs to be converted as full mode
via osd_scrub_join(). Before that, it will check whether the
current OI scrub is full mode or not. Originally, we checked
the SF_AUTO flags (scrub::os_file.sf_flags) only, but ignored
the partial mode (scrub::os_partial_scan). The partial mode
OI scrub will NOT change the scrub iteration cursor (srub::
os_pos_current). So if miss to convert the partial OI scrub,
the subsequent inode table based iteration will be blocked
inside osd_otable_it_next() as following:
if (it->ooi_cache.ooc_pos_preload >= scrub->os_pos_current)
l_wait_event(thread->t_ctl_waitq,
osd_otable_it_wakeup(scrub, it),
&lwi);
This patch fix such issue by checking the conditions properly.
Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I41cf519e717f356f21a1eebebefda1e44a3bd5ae
Reviewed-on: http://review.whamcloud.com/18175
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
again:
if (thread_is_running(thread)) {
spin_unlock(&scrub->os_lock);
- if (!(scrub->os_file.sf_flags & SF_AUTO) ||
+ if (!(scrub->os_file.sf_flags & SF_AUTO ||
+ scrub->os_partial_scan) ||
(flags & (SS_AUTO_FULL | SS_AUTO_PARTIAL)))
RETURN(-EALREADY);
if (it->ooi_user_ready)
RETURN(-EPERM);
+ LASSERT(!scrub->os_partial_scan);
+
if (hash > OSD_OTABLE_MAX_HASH)
hash = OSD_OTABLE_MAX_HASH;