Currently, IR does not notify LWPs and MDT-MDT OSPs of target
recoveries. This patch removes OBD_CONNECT_PINGLESS from LWP and
MDT-MDT OSP connect requests.
Although an MGC does not know if IR is administratively disabled on
the MGS or if a particular target is mounted with "noir", it can
detect MGSs that do not support IR at all and MGSs that are
unreachable. This patch stops suppressing pings under those two
cases.
As a cleanup requested by the reviewers, this patch also replaces the
plain OBD_CONNECT_PINGLESS checks with OCD_HAS_FLAG(..., PINGLESS)
macros.
Change-Id: I993b46c8f33413793d9cf2fa1a73b3635996a206
Signed-off-by: Li Wei <wei.g.li@intel.com>
Reviewed-on: http://review.whamcloud.com/5900
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Tested-by: Hudson
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
#define ping_evictor_stop() do {} while (0)
#endif
int ptlrpc_check_and_wait_suspend(struct ptlrpc_request *req);
#define ping_evictor_stop() do {} while (0)
#endif
int ptlrpc_check_and_wait_suspend(struct ptlrpc_request *req);
+void ptlrpc_pinger_ir_up(void);
+void ptlrpc_pinger_ir_down(void);
/** @} */
int ptlrpc_pinger_suppress_pings(void);
/** @} */
int ptlrpc_pinger_suppress_pings(void);
OBD_CONNECT_MDS_MDS |
OBD_CONNECT_FID |
OBD_CONNECT_AT |
OBD_CONNECT_MDS_MDS |
OBD_CONNECT_FID |
OBD_CONNECT_AT |
- OBD_CONNECT_FULL20 |
- OBD_CONNECT_PINGLESS;
/* XXX set MDS-MDS flags, remove this when running this
* on client*/
data->ocd_connect_flags |= OBD_CONNECT_MDS_MDS;
/* XXX set MDS-MDS flags, remove this when running this
* on client*/
data->ocd_connect_flags |= OBD_CONNECT_MDS_MDS;
- if (data->ocd_connect_flags & OBD_CONNECT_PINGLESS) {
+ if (OCD_HAS_FLAG(data, PINGLESS)) {
if (ptlrpc_pinger_suppress_pings()) {
spin_lock(&exp->exp_obd->obd_dev_lock);
list_del_init(&exp->exp_obd_chain_timed);
if (ptlrpc_pinger_suppress_pings()) {
spin_lock(&exp->exp_obd->obd_dev_lock);
list_del_init(&exp->exp_obd_chain_timed);
switch (event) {
case IMP_EVENT_DISCON:
/* MGC imports should not wait for recovery */
switch (event) {
case IMP_EVENT_DISCON:
/* MGC imports should not wait for recovery */
+ if (OCD_HAS_FLAG(&imp->imp_connect_data, IMP_RECOV))
+ ptlrpc_pinger_ir_down();
break;
case IMP_EVENT_INACTIVE:
break;
break;
case IMP_EVENT_INACTIVE:
break;
/* Clearing obd_no_recov allows us to continue pinging */
obd->obd_no_recov = 0;
mgc_notify_active(obd);
/* Clearing obd_no_recov allows us to continue pinging */
obd->obd_no_recov = 0;
mgc_notify_active(obd);
+ if (OCD_HAS_FLAG(&imp->imp_connect_data, IMP_RECOV))
+ ptlrpc_pinger_ir_up();
break;
case IMP_EVENT_OCD:
break;
break;
case IMP_EVENT_OCD:
break;
data->ocd_connect_flags |= OBD_CONNECT_MDS_MDS | OBD_CONNECT_FID |
OBD_CONNECT_AT | OBD_CONNECT_LRU_RESIZE |
OBD_CONNECT_FULL20 | OBD_CONNECT_LVB_TYPE |
data->ocd_connect_flags |= OBD_CONNECT_MDS_MDS | OBD_CONNECT_FID |
OBD_CONNECT_AT | OBD_CONNECT_LRU_RESIZE |
OBD_CONNECT_FULL20 | OBD_CONNECT_LVB_TYPE |
- OBD_CONNECT_LIGHTWEIGHT |
- OBD_CONNECT_PINGLESS;
+ OBD_CONNECT_LIGHTWEIGHT;
OBD_ALLOC_PTR(uuid);
if (uuid == NULL)
GOTO(out, rc = -ENOMEM);
OBD_ALLOC_PTR(uuid);
if (uuid == NULL)
GOTO(out, rc = -ENOMEM);
if (data->ocd_connect_flags & OBD_CONNECT_MAXBYTES)
data->ocd_maxbytes = ofd->ofd_dt_conf.ddp_maxbytes;
if (data->ocd_connect_flags & OBD_CONNECT_MAXBYTES)
data->ocd_maxbytes = ofd->ofd_dt_conf.ddp_maxbytes;
- if (data->ocd_connect_flags & OBD_CONNECT_PINGLESS) {
+ if (OCD_HAS_FLAG(data, PINGLESS)) {
if (ptlrpc_pinger_suppress_pings()) {
spin_lock(&exp->exp_obd->obd_dev_lock);
list_del_init(&exp->exp_obd_chain_timed);
if (ptlrpc_pinger_suppress_pings()) {
spin_lock(&exp->exp_obd->obd_dev_lock);
list_del_init(&exp->exp_obd_chain_timed);
+static bool ir_up;
+
+void ptlrpc_pinger_ir_up(void)
+{
+ CDEBUG(D_HA, "IR up\n");
+ ir_up = true;
+}
+EXPORT_SYMBOL(ptlrpc_pinger_ir_up);
+
+void ptlrpc_pinger_ir_down(void)
+{
+ CDEBUG(D_HA, "IR down\n");
+ ir_up = false;
+}
+EXPORT_SYMBOL(ptlrpc_pinger_ir_down);
+
static void ptlrpc_pinger_process_import(struct obd_import *imp,
unsigned long this_ping)
{
static void ptlrpc_pinger_process_import(struct obd_import *imp,
unsigned long this_ping)
{
/*
* This will be used below only if the import is "FULL".
*/
/*
* This will be used below only if the import is "FULL".
*/
- suppress = !!(imp->imp_connect_data.ocd_connect_flags &
- OBD_CONNECT_PINGLESS);
+ suppress = ir_up && OCD_HAS_FLAG(&imp->imp_connect_data, PINGLESS);
imp->imp_force_verify = 0;
imp->imp_force_verify = 0;
* imp_peer_committed_transno.
*/
if (imp->imp_state != LUSTRE_IMP_FULL ||
* imp_peer_committed_transno.
*/
if (imp->imp_state != LUSTRE_IMP_FULL ||
- imp->imp_connect_data.ocd_connect_flags & OBD_CONNECT_PINGLESS)
+ OCD_HAS_FLAG(&imp->imp_connect_data, PINGLESS))
imp->imp_force_next_verify = 1;
}
imp->imp_force_next_verify = 1;
}