Whamcloud - gitweb
i=liang,b=13065:
[fs/lustre-release.git] / lnet / lnet / lib-eq.c
index 4ca84f3..701352c 100644 (file)
@@ -219,6 +219,16 @@ LNetEQPoll (lnet_handle_eq_t *eventqs, int neq, int timeout_ms,
         LNET_LOCK();
 
         for (;;) {
+#ifndef __KERNEL__
+                LNET_UNLOCK();
+
+                /* Recursion breaker */
+                if (the_lnet.ln_rc_state == LNET_RC_STATE_RUNNING &&
+                    !LNetHandleIsEqual(eventqs[0], the_lnet.ln_rc_eqh))
+                        lnet_router_checker();
+
+                LNET_LOCK();
+#endif
                 for (i = 0; i < neq; i++) {
                         lnet_eq_t *eq = lnet_handle2eq(&eventqs[i]);
 
@@ -256,8 +266,8 @@ LNetEQPoll (lnet_handle_eq_t *eventqs, int neq, int timeout_ms,
                         cfs_waitq_timedwait(&wl, CFS_TASK_INTERRUPTIBLE,
                                             cfs_time_seconds(timeout_ms)/1000);
                         cfs_duration_usec(cfs_time_sub(cfs_time_current(), now),
-                                          &tv);
-                        timeout_ms -= tv.tv_sec * 1000 + tv.tv_usec / 1000;
+                                            &tv);
+                        timeout_ms -= (int)(tv.tv_sec * 1000 + tv.tv_usec / 1000);
                         if (timeout_ms < 0)
                                 timeout_ms = 0;
                 }