summaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre
diff options
context:
space:
mode:
authorAndriy Skulysh <Andriy_Skulysh@xyratex.com>2015-03-25 22:07:07 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-03-26 11:11:15 +0100
commit502cb58e2138dea3cef0da29021528172ff9fe58 (patch)
tree2ac061cf17861b10fe75c0388bd92ffe5cfdb010 /drivers/staging/lustre
parent397632e467d195a268ac3c5adfd7de32e92bd864 (diff)
downloadop-kernel-dev-502cb58e2138dea3cef0da29021528172ff9fe58.zip
op-kernel-dev-502cb58e2138dea3cef0da29021528172ff9fe58.tar.gz
staging/lustre/ptlrpc: fix import state during replay
Client doesn't restore import state correctly on reconnect during replay. It resends lock replay when final ping was queued by server. Server fails with "target_queue_recovery_request()) ASSERTION( req->rq_export->exp_lock_replay_needed ) failed" Add imp_replay_state to store last replay state. imp_state is restored from imp_replay_state during reconnect. Signed-off-by: Andriy Skulysh <Andriy_Skulysh@xyratex.com> Signed-off-by: Bob Glossman <bob.glossman@intel.com> Xyratex-bug-id: MRP-2022 Reviewed-on: http://review.whamcloud.com/12163 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5651 Reviewed-by: Jian Yu <jian.yu@intel.com> Reviewed-by: James Simmons <uja.ornl@gmail.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre')
-rw-r--r--drivers/staging/lustre/lustre/include/lustre_import.h2
-rw-r--r--drivers/staging/lustre/lustre/ptlrpc/import.c15
2 files changed, 16 insertions, 1 deletions
diff --git a/drivers/staging/lustre/lustre/include/lustre_import.h b/drivers/staging/lustre/lustre/include/lustre_import.h
index 51f3e98..dcc8076 100644
--- a/drivers/staging/lustre/lustre/include/lustre_import.h
+++ b/drivers/staging/lustre/lustre/include/lustre_import.h
@@ -218,6 +218,8 @@ struct obd_import {
atomic_t imp_timeouts;
/** Current import state */
enum lustre_imp_state imp_state;
+ /** Last replay state */
+ enum lustre_imp_state imp_replay_state;
/** History of import states */
struct import_state_hist imp_state_hist[IMP_STATE_HIST_LEN];
int imp_state_hist_idx;
diff --git a/drivers/staging/lustre/lustre/ptlrpc/import.c b/drivers/staging/lustre/lustre/ptlrpc/import.c
index 4ceb90d..d5fc689 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/import.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/import.c
@@ -63,6 +63,19 @@ struct ptlrpc_connect_async_args {
static void __import_set_state(struct obd_import *imp,
enum lustre_imp_state state)
{
+ switch (state) {
+ case LUSTRE_IMP_CLOSED:
+ case LUSTRE_IMP_NEW:
+ case LUSTRE_IMP_DISCON:
+ case LUSTRE_IMP_CONNECTING:
+ break;
+ case LUSTRE_IMP_REPLAY_WAIT:
+ imp->imp_replay_state = LUSTRE_IMP_REPLAY_LOCKS;
+ break;
+ default:
+ imp->imp_replay_state = LUSTRE_IMP_REPLAY;
+ }
+
imp->imp_state = state;
imp->imp_state_hist[imp->imp_state_hist_idx].ish_state = state;
imp->imp_state_hist[imp->imp_state_hist_idx].ish_time =
@@ -966,7 +979,7 @@ static int ptlrpc_connect_interpret(const struct lu_env *env,
imp->imp_resend_replay = 1;
spin_unlock(&imp->imp_lock);
- IMPORT_SET_STATE(imp, LUSTRE_IMP_REPLAY);
+ IMPORT_SET_STATE(imp, imp->imp_replay_state);
} else {
IMPORT_SET_STATE(imp, LUSTRE_IMP_RECOVER);
}
OpenPOWER on IntegriCloud