Whamcloud - gitweb
LU-7302 scrub: join the running OI scrub properly 75/18175/2
authorFan Yong <fan.yong@intel.com>
Sun, 22 Nov 2015 05:38:11 +0000 (13:38 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 14 Jun 2016 03:50:48 +0000 (03:50 +0000)
commit93205e724bd7a07ef56636d1042a430777b89405
tree31735ccd820abff976120af00803887437f59b92
parent909e4dc00f224834ff7ac4b6b8f0f6bf76e3c58d
LU-7302 scrub: join the running OI scrub properly

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>
lustre/osd-ldiskfs/osd_scrub.c