1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 only,
10 * as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License version 2 for more details (a copy is included
16 * in the LICENSE file that accompanied this code).
18 * You should have received a copy of the GNU General Public License
19 * version 2 along with this program; If not, see
20 * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
29 * Copyright 2008 Sun Microsystems, Inc. All rights reserved
30 * Use is subject to license terms.
33 * This file is part of Lustre, http://www.lustre.org/
34 * Lustre is a trademark of Sun Microsystems, Inc.
36 * lustre/ptlrpc/pinger.c
38 * Portal-RPC reconnection and replay operations, for use in recovery.
42 #include <liblustre.h>
44 #define DEBUG_SUBSYSTEM S_RPC
47 #include <obd_support.h>
48 #include <obd_class.h>
49 #include "ptlrpc_internal.h"
51 struct semaphore pinger_sem;
52 static CFS_LIST_HEAD(pinger_imports);
54 struct ptlrpc_request *
55 ptlrpc_prep_ping(struct obd_import *imp)
57 struct ptlrpc_request *req;
59 req = ptlrpc_request_alloc_pack(imp, &RQF_OBD_PING,
60 LUSTRE_OBD_VERSION, OBD_PING);
62 ptlrpc_request_set_replen(req);
63 req->rq_no_resend = req->rq_no_delay = 1;
68 int ptlrpc_obd_ping(struct obd_device *obd)
71 struct ptlrpc_request *req;
74 req = ptlrpc_prep_ping(obd->u.cli.cl_import);
78 req->rq_send_state = LUSTRE_IMP_FULL;
80 rc = ptlrpc_queue_wait(req);
82 ptlrpc_req_finished(req);
86 EXPORT_SYMBOL(ptlrpc_obd_ping);
88 int ptlrpc_ping(struct obd_import *imp)
90 struct ptlrpc_request *req;
93 req = ptlrpc_prep_ping(imp);
95 CERROR("OOM trying to ping %s->%s\n",
96 imp->imp_obd->obd_uuid.uuid,
97 obd2cli_tgt(imp->imp_obd));
101 DEBUG_REQ(D_INFO, req, "pinging %s->%s",
102 imp->imp_obd->obd_uuid.uuid, obd2cli_tgt(imp->imp_obd));
103 ptlrpcd_add_req(req, PSCOPE_OTHER);
108 void ptlrpc_update_next_ping(struct obd_import *imp)
111 int time = PING_INTERVAL;
112 if (imp->imp_state == LUSTRE_IMP_DISCON) {
113 int dtime = max_t(int, CONNECTION_SWITCH_MIN,
115 at_get(&imp->imp_at.iat_net_latency));
116 time = min(time, dtime);
118 imp->imp_next_ping = cfs_time_shift(time);
119 #endif /* ENABLE_PINGER */
122 void ptlrpc_ping_import_soon(struct obd_import *imp)
124 imp->imp_next_ping = cfs_time_current();
127 static inline int ptlrpc_next_reconnect(struct obd_import *imp)
129 if (imp->imp_server_timeout)
130 return cfs_time_shift(obd_timeout / 2);
132 return cfs_time_shift(obd_timeout);
135 static atomic_t suspend_timeouts = ATOMIC_INIT(0);
136 static cfs_time_t suspend_wakeup_time = 0;
139 static wait_queue_head_t suspend_timeouts_waitq;
142 cfs_time_t ptlrpc_suspend_wakeup_time(void)
144 return suspend_wakeup_time;
147 void ptlrpc_deactivate_timeouts(struct obd_import *imp)
149 /*XXX: disabled for now, will be replaced by adaptive timeouts */
151 if (imp->imp_no_timeout)
153 imp->imp_no_timeout = 1;
154 atomic_inc(&suspend_timeouts);
155 CDEBUG(D_HA|D_WARNING, "deactivate timeouts %u\n", atomic_read(&suspend_timeouts));
159 void ptlrpc_activate_timeouts(struct obd_import *imp)
161 /*XXX: disabled for now, will be replaced by adaptive timeouts */
163 if (!imp->imp_no_timeout)
165 imp->imp_no_timeout = 0;
166 LASSERT(atomic_read(&suspend_timeouts) > 0);
167 if (atomic_dec_and_test(&suspend_timeouts)) {
168 suspend_wakeup_time = cfs_time_current();
169 wake_up(&suspend_timeouts_waitq);
171 CDEBUG(D_HA|D_WARNING, "activate timeouts %u\n", atomic_read(&suspend_timeouts));
175 int ptlrpc_check_suspend(void)
177 if (atomic_read(&suspend_timeouts))
182 int ptlrpc_check_and_wait_suspend(struct ptlrpc_request *req)
184 struct l_wait_info lwi;
186 if (atomic_read(&suspend_timeouts)) {
187 DEBUG_REQ(D_NET, req, "-- suspend %d regular timeout",
188 atomic_read(&suspend_timeouts));
189 lwi = LWI_INTR(NULL, NULL);
190 l_wait_event(suspend_timeouts_waitq,
191 atomic_read(&suspend_timeouts) == 0, &lwi);
192 DEBUG_REQ(D_NET, req, "-- recharge regular timeout");
200 static void ptlrpc_pinger_process_import(struct obd_import *imp,
201 unsigned long this_ping)
205 spin_lock(&imp->imp_lock);
206 level = imp->imp_state;
207 force = imp->imp_force_verify;
209 imp->imp_force_verify = 0;
210 spin_unlock(&imp->imp_lock);
212 CDEBUG(level == LUSTRE_IMP_FULL ? D_INFO : D_HA,
213 "level %s/%u force %u deactive %u pingable %u\n",
214 ptlrpc_import_state_name(level), level,
215 force, imp->imp_deactive, imp->imp_pingable);
217 if (cfs_time_aftereq(imp->imp_next_ping - 5 * CFS_TICK,
218 this_ping) && force == 0)
221 if (level == LUSTRE_IMP_DISCON && !imp->imp_deactive) {
222 /* wait at least a timeout before trying recovery again */
223 imp->imp_next_ping = ptlrpc_next_reconnect(imp);
224 ptlrpc_initiate_recovery(imp);
225 } else if (level != LUSTRE_IMP_FULL ||
226 imp->imp_obd->obd_no_recov ||
228 CDEBUG(D_HA, "not pinging %s (in recovery "
229 " or recovery disabled: %s)\n",
230 obd2cli_tgt(imp->imp_obd),
231 ptlrpc_import_state_name(level));
232 } else if (imp->imp_pingable || force) {
237 static int ptlrpc_pinger_main(void *arg)
239 struct ptlrpc_svc_data *data = (struct ptlrpc_svc_data *)arg;
240 struct ptlrpc_thread *thread = data->thread;
243 cfs_daemonize(data->name);
245 /* Record that the thread is running */
246 thread->t_flags = SVC_RUNNING;
247 cfs_waitq_signal(&thread->t_ctl_waitq);
249 /* And now, loop forever, pinging as needed. */
251 cfs_time_t this_ping = cfs_time_current();
252 struct l_wait_info lwi;
253 cfs_duration_t time_to_next_ping;
254 struct list_head *iter;
256 mutex_down(&pinger_sem);
257 list_for_each(iter, &pinger_imports) {
258 struct obd_import *imp =
259 list_entry(iter, struct obd_import,
262 ptlrpc_pinger_process_import(imp, this_ping);
263 /* obd_timeout might have changed */
264 if (imp->imp_pingable && imp->imp_next_ping &&
265 cfs_time_after(imp->imp_next_ping,
266 cfs_time_add(this_ping,
267 cfs_time_seconds(PING_INTERVAL))))
268 ptlrpc_update_next_ping(imp);
270 mutex_up(&pinger_sem);
271 /* update memory usage info */
272 obd_update_maxusage();
274 /* Wait until the next ping time, or until we're stopped. */
275 time_to_next_ping = cfs_time_sub(cfs_time_add(this_ping,
276 cfs_time_seconds(PING_INTERVAL)),
279 /* The ping sent by ptlrpc_send_rpc may get sent out
280 say .01 second after this.
281 ptlrpc_pinger_sending_on_import will then set the
282 next ping time to next_ping + .01 sec, which means
283 we will SKIP the next ping at next_ping, and the
284 ping will get sent 2 timeouts from now! Beware. */
285 CDEBUG(D_INFO, "next ping in "CFS_DURATION_T" ("CFS_TIME_T")\n",
287 cfs_time_add(this_ping,
288 cfs_time_seconds(PING_INTERVAL)));
289 if (time_to_next_ping > 0) {
290 lwi = LWI_TIMEOUT(max_t(cfs_duration_t,
292 cfs_time_seconds(1)),
294 l_wait_event(thread->t_ctl_waitq,
295 thread->t_flags & (SVC_STOPPING|SVC_EVENT),
297 if (thread->t_flags & SVC_STOPPING) {
298 thread->t_flags &= ~SVC_STOPPING;
301 } else if (thread->t_flags & SVC_EVENT) {
302 /* woken after adding import to reset timer */
303 thread->t_flags &= ~SVC_EVENT;
308 thread->t_flags = SVC_STOPPED;
309 cfs_waitq_signal(&thread->t_ctl_waitq);
311 CDEBUG(D_NET, "pinger thread exiting, process %d\n", cfs_curproc_pid());
315 static struct ptlrpc_thread *pinger_thread = NULL;
317 int ptlrpc_start_pinger(void)
319 struct l_wait_info lwi = { 0 };
320 struct ptlrpc_svc_data d;
322 #ifndef ENABLE_PINGER
327 if (pinger_thread != NULL)
330 OBD_ALLOC_PTR(pinger_thread);
331 if (pinger_thread == NULL)
333 cfs_waitq_init(&pinger_thread->t_ctl_waitq);
334 cfs_waitq_init(&suspend_timeouts_waitq);
337 d.thread = pinger_thread;
339 /* CLONE_VM and CLONE_FILES just avoid a needless copy, because we
340 * just drop the VM and FILES in ptlrpc_daemonize() right away. */
341 rc = cfs_kernel_thread(ptlrpc_pinger_main, &d, CLONE_VM | CLONE_FILES);
343 CERROR("cannot start thread: %d\n", rc);
344 OBD_FREE(pinger_thread, sizeof(*pinger_thread));
345 pinger_thread = NULL;
348 l_wait_event(pinger_thread->t_ctl_waitq,
349 pinger_thread->t_flags & SVC_RUNNING, &lwi);
354 int ptlrpc_stop_pinger(void)
356 struct l_wait_info lwi = { 0 };
358 #ifndef ENABLE_PINGER
363 if (pinger_thread == NULL)
365 mutex_down(&pinger_sem);
366 pinger_thread->t_flags = SVC_STOPPING;
367 cfs_waitq_signal(&pinger_thread->t_ctl_waitq);
368 mutex_up(&pinger_sem);
370 l_wait_event(pinger_thread->t_ctl_waitq,
371 (pinger_thread->t_flags & SVC_STOPPED), &lwi);
373 OBD_FREE_PTR(pinger_thread);
374 pinger_thread = NULL;
378 void ptlrpc_pinger_sending_on_import(struct obd_import *imp)
380 ptlrpc_update_next_ping(imp);
383 int ptlrpc_pinger_add_import(struct obd_import *imp)
386 if (!list_empty(&imp->imp_pinger_chain))
389 mutex_down(&pinger_sem);
390 CDEBUG(D_HA, "adding pingable import %s->%s\n",
391 imp->imp_obd->obd_uuid.uuid, obd2cli_tgt(imp->imp_obd));
392 /* if we add to pinger we want recovery on this import */
393 imp->imp_obd->obd_no_recov = 0;
394 ptlrpc_update_next_ping(imp);
395 /* XXX sort, blah blah */
396 list_add_tail(&imp->imp_pinger_chain, &pinger_imports);
397 class_import_get(imp);
399 ptlrpc_pinger_wake_up();
400 mutex_up(&pinger_sem);
405 int ptlrpc_pinger_del_import(struct obd_import *imp)
408 if (list_empty(&imp->imp_pinger_chain))
411 mutex_down(&pinger_sem);
412 list_del_init(&imp->imp_pinger_chain);
413 CDEBUG(D_HA, "removing pingable import %s->%s\n",
414 imp->imp_obd->obd_uuid.uuid, obd2cli_tgt(imp->imp_obd));
415 /* if we remove from pinger we don't want recovery on this import */
416 imp->imp_obd->obd_no_recov = 1;
417 class_import_put(imp);
418 mutex_up(&pinger_sem);
422 void ptlrpc_pinger_wake_up()
425 pinger_thread->t_flags |= SVC_EVENT;
426 cfs_waitq_signal(&pinger_thread->t_ctl_waitq);
430 /* Ping evictor thread */
432 #define PET_TERMINATE 2
434 static int pet_refcount = 0;
435 static int pet_state;
436 static wait_queue_head_t pet_waitq;
437 static struct obd_export *pet_exp = NULL;
438 static spinlock_t pet_lock = SPIN_LOCK_UNLOCKED;
440 int ping_evictor_wake(struct obd_export *exp)
442 spin_lock(&pet_lock);
443 if (pet_exp || (pet_state != PET_READY)) {
444 /* eventually the new obd will call here again. */
445 spin_unlock(&pet_lock);
449 /* We have to make sure the obd isn't destroyed between now and when
450 * the ping evictor runs. We'll take a reference here, and drop it
451 * when we finish in the evictor. We don't really care about this
452 * export in particular; we just need one to keep the obd alive. */
453 pet_exp = class_export_get(exp);
454 spin_unlock(&pet_lock);
460 static int ping_evictor_main(void *arg)
462 struct obd_device *obd;
463 struct obd_export *exp;
464 struct l_wait_info lwi = { 0 };
468 ptlrpc_daemonize("ll_evictor");
470 CDEBUG(D_HA, "Starting Ping Evictor\n");
472 pet_state = PET_READY;
474 l_wait_event(pet_waitq, pet_exp ||
475 (pet_state == PET_TERMINATE), &lwi);
476 if (pet_state == PET_TERMINATE)
479 /* we only get here if pet_exp != NULL, and the end of this
480 * loop is the only place which sets it NULL again, so lock
481 * is not strictly necessary. */
482 spin_lock(&pet_lock);
483 obd = pet_exp->exp_obd;
484 spin_unlock(&pet_lock);
486 expire_time = cfs_time_current_sec() - PING_EVICT_TIMEOUT;
488 CDEBUG(D_HA, "evicting all exports of obd %s older than %ld\n",
489 obd->obd_name, expire_time);
491 /* Exports can't be deleted out of the list while we hold
492 * the obd lock (class_unlink_export), which means we can't
493 * lose the last ref on the export. If they've already been
494 * removed from the list, we won't find them here. */
495 spin_lock(&obd->obd_dev_lock);
496 while (!list_empty(&obd->obd_exports_timed)) {
497 exp = list_entry(obd->obd_exports_timed.next,
498 struct obd_export,exp_obd_chain_timed);
499 if (expire_time > exp->exp_last_request_time) {
500 class_export_get(exp);
501 spin_unlock(&obd->obd_dev_lock);
502 LCONSOLE_WARN("%s: haven't heard from client %s"
503 " (at %s) in %ld seconds. I think"
504 " it's dead, and I am evicting"
505 " it. exp %p, cur %ld expire %ld"
508 obd_uuid2str(&exp->exp_client_uuid),
509 obd_export_nid2str(exp),
510 (long)(cfs_time_current_sec() -
511 exp->exp_last_request_time),
512 exp, (long)cfs_time_current_sec(),
514 (long)exp->exp_last_request_time);
515 CDEBUG(D_HA, "Last request was at %ld\n",
516 exp->exp_last_request_time);
517 class_fail_export(exp);
518 class_export_put(exp);
519 spin_lock(&obd->obd_dev_lock);
521 /* List is sorted, so everyone below is ok */
525 spin_unlock(&obd->obd_dev_lock);
527 class_export_put(pet_exp);
529 spin_lock(&pet_lock);
531 spin_unlock(&pet_lock);
533 CDEBUG(D_HA, "Exiting Ping Evictor\n");
538 void ping_evictor_start(void)
542 if (++pet_refcount > 1)
545 init_waitqueue_head(&pet_waitq);
547 rc = cfs_kernel_thread(ping_evictor_main, NULL, CLONE_VM | CLONE_FILES);
550 CERROR("Cannot start ping evictor thread: %d\n", rc);
553 EXPORT_SYMBOL(ping_evictor_start);
555 void ping_evictor_stop(void)
557 if (--pet_refcount > 0)
560 pet_state = PET_TERMINATE;
563 EXPORT_SYMBOL(ping_evictor_stop);
564 #else /* !__KERNEL__ */
567 * the current implementation of pinger in liblustre is not optimized
571 static struct pinger_data {
573 cfs_time_t pd_this_ping; /* jiffies */
574 cfs_time_t pd_next_ping; /* jiffies */
575 struct ptlrpc_request_set *pd_set;
578 static int pinger_check_rpcs(void *arg)
580 cfs_time_t curtime = cfs_time_current();
581 struct ptlrpc_request *req;
582 struct ptlrpc_request_set *set;
583 struct list_head *iter;
584 struct obd_import *imp;
585 struct pinger_data *pd = &pinger_args;
588 /* prevent recursion */
589 if (pd->pd_recursion++) {
590 CDEBUG(D_HA, "pinger: recursion! quit\n");
596 /* have we reached ping point? */
597 if (!pd->pd_set && time_before(curtime, pd->pd_next_ping)) {
602 /* if we have rpc_set already, continue processing it */
604 LASSERT(pd->pd_this_ping);
609 pd->pd_this_ping = curtime;
610 pd->pd_set = ptlrpc_prep_set();
611 if (pd->pd_set == NULL)
615 /* add rpcs into set */
616 mutex_down(&pinger_sem);
617 list_for_each(iter, &pinger_imports) {
618 struct obd_import *imp =
619 list_entry(iter, struct obd_import, imp_pinger_chain);
620 int generation, level;
622 if (cfs_time_aftereq(pd->pd_this_ping,
623 imp->imp_next_ping - 5 * CFS_TICK)) {
625 spin_lock(&imp->imp_lock);
626 generation = imp->imp_generation;
627 level = imp->imp_state;
628 spin_unlock(&imp->imp_lock);
630 if (level != LUSTRE_IMP_FULL) {
632 "not pinging %s (in recovery)\n",
633 obd2cli_tgt(imp->imp_obd));
637 req = ptlrpc_request_alloc_pack(imp, &RQF_OBD_PING,
641 CERROR("OOM trying to ping %s->%s\n",
642 imp->imp_obd->obd_uuid.uuid,
643 obd2cli_tgt(imp->imp_obd));
647 req->rq_no_resend = 1;
648 ptlrpc_request_set_replen(req);
649 req->rq_send_state = LUSTRE_IMP_FULL;
650 ptlrpc_rqphase_move(req, RQ_PHASE_RPC);
651 req->rq_import_generation = generation;
652 ptlrpc_set_add_req(set, req);
654 CDEBUG(D_INFO, "don't need to ping %s ("CFS_TIME_T
655 " > "CFS_TIME_T")\n", obd2cli_tgt(imp->imp_obd),
656 imp->imp_next_ping, pd->pd_this_ping);
659 pd->pd_this_ping = curtime;
660 mutex_up(&pinger_sem);
662 /* Might be empty, that's OK. */
663 if (set->set_remaining == 0)
664 CDEBUG(D_RPCTRACE, "nothing to ping\n");
666 list_for_each(iter, &set->set_requests) {
667 struct ptlrpc_request *req =
668 list_entry(iter, struct ptlrpc_request,
670 DEBUG_REQ(D_RPCTRACE, req, "pinging %s->%s",
671 req->rq_import->imp_obd->obd_uuid.uuid,
672 obd2cli_tgt(req->rq_import->imp_obd));
673 (void)ptl_send_rpc(req, 0);
677 rc = ptlrpc_check_set(NULL, set);
679 /* not finished, and we are not expired, simply return */
680 if (!rc && cfs_time_before(curtime, cfs_time_add(pd->pd_this_ping,
681 cfs_time_seconds(PING_INTERVAL)))) {
682 CDEBUG(D_RPCTRACE, "not finished, but also not expired\n");
687 /* Expire all the requests that didn't come back. */
688 mutex_down(&pinger_sem);
689 list_for_each(iter, &set->set_requests) {
690 req = list_entry(iter, struct ptlrpc_request,
693 if (req->rq_phase == RQ_PHASE_COMPLETE)
696 CDEBUG(D_RPCTRACE, "Pinger initiate expire request(%p)\n",
699 /* This will also unregister reply. */
700 ptlrpc_expire_one_request(req, 0);
702 /* We're done with this req, let's finally move it to complete
703 * phase and take care of inflights. */
704 ptlrpc_rqphase_move(req, RQ_PHASE_COMPLETE);
705 imp = req->rq_import;
706 spin_lock(&imp->imp_lock);
707 if (!list_empty(&req->rq_list)) {
708 list_del_init(&req->rq_list);
709 atomic_dec(&imp->imp_inflight);
711 spin_unlock(&imp->imp_lock);
712 set->set_remaining--;
714 mutex_up(&pinger_sem);
716 ptlrpc_set_destroy(set);
720 pd->pd_next_ping = cfs_time_add(pd->pd_this_ping,
721 cfs_time_seconds(PING_INTERVAL));
722 pd->pd_this_ping = 0; /* XXX for debug */
724 CDEBUG(D_INFO, "finished a round ping\n");
729 static void *pinger_callback = NULL;
730 #endif /* ENABLE_PINGER */
732 int ptlrpc_start_pinger(void)
735 memset(&pinger_args, 0, sizeof(pinger_args));
736 pinger_callback = liblustre_register_wait_callback("pinger_check_rpcs",
743 int ptlrpc_stop_pinger(void)
747 liblustre_deregister_wait_callback(pinger_callback);
752 void ptlrpc_pinger_sending_on_import(struct obd_import *imp)
755 mutex_down(&pinger_sem);
756 ptlrpc_update_next_ping(imp);
757 if (pinger_args.pd_set == NULL &&
758 time_before(imp->imp_next_ping, pinger_args.pd_next_ping)) {
759 CDEBUG(D_HA, "set next ping to "CFS_TIME_T"(cur "CFS_TIME_T")\n",
760 imp->imp_next_ping, cfs_time_current());
761 pinger_args.pd_next_ping = imp->imp_next_ping;
763 mutex_up(&pinger_sem);
767 int ptlrpc_pinger_add_import(struct obd_import *imp)
770 if (!list_empty(&imp->imp_pinger_chain))
773 CDEBUG(D_HA, "adding pingable import %s->%s\n",
774 imp->imp_obd->obd_uuid.uuid, obd2cli_tgt(imp->imp_obd));
775 ptlrpc_pinger_sending_on_import(imp);
777 mutex_down(&pinger_sem);
778 list_add_tail(&imp->imp_pinger_chain, &pinger_imports);
779 class_import_get(imp);
780 mutex_up(&pinger_sem);
785 int ptlrpc_pinger_del_import(struct obd_import *imp)
788 if (list_empty(&imp->imp_pinger_chain))
791 mutex_down(&pinger_sem);
792 list_del_init(&imp->imp_pinger_chain);
793 CDEBUG(D_HA, "removing pingable import %s->%s\n",
794 imp->imp_obd->obd_uuid.uuid, obd2cli_tgt(imp->imp_obd));
795 class_import_put(imp);
796 mutex_up(&pinger_sem);
800 void ptlrpc_pinger_wake_up()
803 /* XXX force pinger to run, if needed */
804 struct obd_import *imp;
806 list_for_each_entry(imp, &pinger_imports, imp_pinger_chain) {
807 CDEBUG(D_RPCTRACE, "checking import %s->%s\n",
808 imp->imp_obd->obd_uuid.uuid, obd2cli_tgt(imp->imp_obd));
809 #ifdef ENABLE_LIBLUSTRE_RECOVERY
810 if (imp->imp_state == LUSTRE_IMP_DISCON && !imp->imp_deactive)
812 /*XXX only recover for the initial connection */
813 if (!lustre_handle_is_used(&imp->imp_remote_handle) &&
814 imp->imp_state == LUSTRE_IMP_DISCON && !imp->imp_deactive)
816 ptlrpc_initiate_recovery(imp);
817 else if (imp->imp_state != LUSTRE_IMP_FULL)
818 CDEBUG(D_HA, "Refused to recover import %s->%s "
819 "state %d, deactive %d\n",
820 imp->imp_obd->obd_uuid.uuid,
821 obd2cli_tgt(imp->imp_obd), imp->imp_state,
827 #endif /* !__KERNEL__ */