From: Li Wei Date: Sun, 31 Mar 2013 06:48:30 +0000 (+0800) Subject: LU-2923 ptlrpc: Stop suppressing pings when IR is unavailable X-Git-Tag: 2.3.64~22 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=deb7a5c9f42c1fb7a6f225e2eb09b64b79efc64c LU-2923 ptlrpc: Stop suppressing pings when IR is unavailable 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 Reviewed-on: http://review.whamcloud.com/5900 Reviewed-by: Jinshan Xiong Tested-by: Hudson Reviewed-by: Lai Siyao Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/include/lustre_net.h b/lustre/include/lustre_net.h index c5f5d86..9746c27 100644 --- a/lustre/include/lustre_net.h +++ b/lustre/include/lustre_net.h @@ -3152,6 +3152,8 @@ void ping_evictor_stop(void); #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); diff --git a/lustre/lod/lod_lov.c b/lustre/lod/lod_lov.c index 9a9eec1..e99f646 100644 --- a/lustre/lod/lod_lov.c +++ b/lustre/lod/lod_lov.c @@ -243,8 +243,7 @@ int lod_add_device(const struct lu_env *env, struct lod_device *lod, OBD_CONNECT_MDS_MDS | OBD_CONNECT_FID | OBD_CONNECT_AT | - OBD_CONNECT_FULL20 | - OBD_CONNECT_PINGLESS; + OBD_CONNECT_FULL20; /* XXX set MDS-MDS flags, remove this when running this * on client*/ data->ocd_connect_flags |= OBD_CONNECT_MDS_MDS; diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index b9e0c52..1a0d670 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -5186,7 +5186,7 @@ static int mdt_connect_internal(struct obd_export *exp, return -EBADE; } - 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); diff --git a/lustre/mgc/mgc_request.c b/lustre/mgc/mgc_request.c index 9e2357b..6b84a29 100644 --- a/lustre/mgc/mgc_request.c +++ b/lustre/mgc/mgc_request.c @@ -1150,6 +1150,8 @@ static int mgc_import_event(struct obd_device *obd, 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; @@ -1163,6 +1165,8 @@ static int mgc_import_event(struct obd_device *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; diff --git a/lustre/obdclass/obd_mount_server.c b/lustre/obdclass/obd_mount_server.c index 86d19d7..ce7eba5 100644 --- a/lustre/obdclass/obd_mount_server.c +++ b/lustre/obdclass/obd_mount_server.c @@ -522,8 +522,7 @@ static int lustre_lwp_connect(struct obd_device *lwp) 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); diff --git a/lustre/ofd/ofd_obd.c b/lustre/ofd/ofd_obd.c index 737c6f0..3bc97a0 100644 --- a/lustre/ofd/ofd_obd.c +++ b/lustre/ofd/ofd_obd.c @@ -226,7 +226,7 @@ static int ofd_parse_connect_data(const struct lu_env *env, 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); diff --git a/lustre/ptlrpc/pinger.c b/lustre/ptlrpc/pinger.c index b19e96e..8b7d472 100644 --- a/lustre/ptlrpc/pinger.c +++ b/lustre/ptlrpc/pinger.c @@ -232,6 +232,22 @@ int ptlrpc_check_and_wait_suspend(struct ptlrpc_request *req) #ifdef __KERNEL__ +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) { @@ -248,8 +264,7 @@ static void ptlrpc_pinger_process_import(struct obd_import *imp, /* * 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; @@ -453,7 +468,7 @@ void ptlrpc_pinger_commit_expected(struct obd_import *imp) * 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; }