+ rc = lu_env_refill(&env);
+ if (rc != 0) {
+ /*
+ * XXX This is very awkward situation, because
+ * execution can neither continue (request
+ * interpreters assume that env is set up), nor repeat
+ * the loop (as this potentially results in a tight
+ * loop of -ENOMEM's).
+ *
+ * Fortunately, refill only ever does something when
+ * new modules are loaded, i.e., early during boot up.
+ */
+ CERROR("Failure to refill session: %d\n", rc);
+ continue;
+ }
+
+ timeout = ptlrpc_set_next_timeout(pc->pc_set);
+ lwi = LWI_TIMEOUT(cfs_time_seconds(timeout ? timeout : 1),
+ ptlrpc_expired_set, pc->pc_set);
+
+ lu_context_enter(&env.le_ctx);
+ l_wait_event(pc->pc_set->set_waitq,
+ ptlrpcd_check(&env, pc), &lwi);
+ lu_context_exit(&env.le_ctx);
+
+ /*
+ * Abort inflight rpcs for forced stop case.
+ */
+ if (cfs_test_bit(LIOD_STOP, &pc->pc_flags)) {
+ if (cfs_test_bit(LIOD_FORCE, &pc->pc_flags))
+ ptlrpc_abort_set(pc->pc_set);
+ exit++;
+ }