- struct l_wait_info lwi = { 0 };
- struct ptlrpc_request *req;
-
- CDEBUG(D_HA, "Waiting for lock\n");
- l_wait_event(obd->obd_next_transno_waitq,
- check_for_next_lock(obd), &lwi);
+ int abort = 0, expired = 1;
+
+ do {
+ cfs_wait_event(obd->obd_next_transno_waitq, check_routine(obd));
+ cfs_spin_lock_bh(&obd->obd_processing_task_lock);
+ abort = obd->obd_abort_recovery;
+ expired = obd->obd_recovery_expired;
+ obd->obd_recovery_expired = 0;
+ cfs_spin_unlock_bh(&obd->obd_processing_task_lock);
+ if (abort) {
+ CWARN("recovery is aborted, evict exports in recovery\n");
+ /** evict exports which didn't finish recovery yet */
+ class_disconnect_stale_exports(obd, exp_finished);
+ } else if (expired) {
+ /** If some clients died being recovered, evict them */
+ CDEBUG(D_WARNING, "recovery is timed out, evict stale exports\n");
+ /** evict cexports with no replay in queue, they are stalled */
+ class_disconnect_stale_exports(obd, health_check);
+ /** continue with VBR */
+ cfs_spin_lock_bh(&obd->obd_processing_task_lock);
+ obd->obd_version_recov = 1;
+ cfs_spin_unlock_bh(&obd->obd_processing_task_lock);
+ /**
+ * reset timer, recovery will proceed with versions now,
+ * timeout is set just to handle reconnection delays
+ */
+ reset_recovery_timer(obd, RECONNECT_DELAY_MAX, 1);
+ /** Wait for recovery events again, after evicting bad clients */
+ }
+ } while (!abort && expired);