X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Flfsck%2Flfsck_engine.c;h=914ad83a61b8f08d9a5fdc32cfae24101160def8;hp=520ff3527fa8d28dcb0227d12f4160f64f13a57a;hb=5e30a2c06176f50f5e17aba68fdae7e38d922d33;hpb=c6e4c21c4f8b04abc53c1010a697eb3ada4fb315 diff --git a/lustre/lfsck/lfsck_engine.c b/lustre/lfsck/lfsck_engine.c index 520ff35..914ad83 100644 --- a/lustre/lfsck/lfsck_engine.c +++ b/lustre/lfsck/lfsck_engine.c @@ -1711,6 +1711,8 @@ int lfsck_assistant_engine(void *args) GOTO(cleanup, rc = 0); while (test_bit(LAD_IN_DOUBLE_SCAN, &lad->lad_flags)) { + int seconds = 30; + rc = lfsck_assistant_query_others(env, com); if (lfsck_phase2_next_ready(lad)) goto p2_next; @@ -1720,26 +1722,24 @@ int lfsck_assistant_engine(void *args) /* Pull LFSCK status on related targets once * per 30 seconds if we are not notified. */ - lwi = LWI_TIMEOUT_INTERVAL(cfs_time_seconds(30), - cfs_time_seconds(1), - NULL, NULL); - rc = l_wait_event(athread->t_ctl_waitq, - lfsck_phase2_next_ready(lad) || - test_bit(LAD_EXIT, &lad->lad_flags) || - !thread_is_running(mthread), - &lwi); + while (seconds > 0 && + wait_event_idle_timeout( + athread->t_ctl_waitq, + lfsck_phase2_next_ready(lad) || + test_bit(LAD_EXIT, + &lad->lad_flags) || + !thread_is_running(mthread), + cfs_time_seconds(1)) == 0) + seconds -= 1; if (unlikely( test_bit(LAD_EXIT, &lad->lad_flags) || !thread_is_running(mthread))) GOTO(cleanup, rc = 0); - if (rc == -ETIMEDOUT) + if (seconds == 0) continue; - if (rc < 0) - GOTO(cleanup, rc); - p2_next: rc = lao->la_handler_p2(env, com); if (rc != 0)