@@ -353,6 +353,7 @@
#define OBD_FAIL_PTLRPC_LONG_REQ_UNLINK 0x51b
#define OBD_FAIL_PTLRPC_LONG_BOTH_UNLINK 0x51c
#define OBD_FAIL_PTLRPC_BULK_ATTACH 0x521
+#define OBD_FAIL_PTLRPC_CONNECT_RACE 0x531
#define OBD_FAIL_OBD_PING_NET 0x600
/* OBD_FAIL_OBD_LOG_CANCEL_NET 0x601 obsolete since 1.5 */
@@ -38,6 +38,7 @@
#define DEBUG_SUBSYSTEM S_RPC
#include <linux/kthread.h>
+#include <linux/delay.h>
#include <linux/fs_struct.h>
#include <obd_support.h>
#include <lustre_ha.h>
@@ -273,6 +274,10 @@ void ptlrpc_invalidate_import(struct obd_import *imp)
if (!imp->imp_invalid || imp->imp_obd->obd_no_recov)
ptlrpc_deactivate_import(imp);
+ if (OBD_FAIL_PRECHECK(OBD_FAIL_PTLRPC_CONNECT_RACE)) {
+ OBD_RACE(OBD_FAIL_PTLRPC_CONNECT_RACE);
+ msleep(10 * MSEC_PER_SEC);
+ }
CFS_FAIL_TIMEOUT(OBD_FAIL_MGS_CONNECT_NET, 3 * cfs_fail_val / 2);
LASSERT(imp->imp_invalid);
@@ -615,6 +620,7 @@ int ptlrpc_connect_import(struct obd_import *imp)
CERROR("already connected\n");
return 0;
} else if (imp->imp_state == LUSTRE_IMP_CONNECTING ||
+ imp->imp_state == LUSTRE_IMP_EVICTED ||
imp->imp_connected) {
spin_unlock(&imp->imp_lock);
CERROR("already connecting\n");
@@ -339,6 +339,8 @@ int ptlrpc_recover_import(struct obd_import *imp, char *new_uuid, int async)
if (rc)
goto out;
+ OBD_RACE(OBD_FAIL_PTLRPC_CONNECT_RACE);
+
rc = ptlrpc_connect_import(imp);
if (rc)
goto out;