From 1e31ea5a51d3e5102b5ca4d77a70b000cd23e342 Mon Sep 17 00:00:00 2001 From: Mikhail Pershin Date: Tue, 31 Aug 2010 16:21:19 +0400 Subject: [PATCH] b=23636 extend exp_lock protected area in target_process_req_flags Issue was introduced by bug 17660, previously this was protected by obd lock i=zam i=vitaly --- lustre/ldlm/ldlm_lib.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index aa794f7..93f2366 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -1912,25 +1912,27 @@ static int target_process_req_flags(struct obd_device *obd, LASSERT(exp != NULL); if (lustre_msg_get_flags(req->rq_reqmsg) & MSG_REQ_REPLAY_DONE) { /* client declares he's ready to replay locks */ + cfs_spin_lock(&exp->exp_lock); if (exp->exp_req_replay_needed) { - LASSERT(cfs_atomic_read(&obd->obd_req_replay_clients) > - 0); - cfs_spin_lock(&exp->exp_lock); exp->exp_req_replay_needed = 0; cfs_spin_unlock(&exp->exp_lock); + LASSERT(cfs_atomic_read(&obd->obd_req_replay_clients)); cfs_atomic_dec(&obd->obd_req_replay_clients); + } else { + cfs_spin_unlock(&exp->exp_lock); } } if (lustre_msg_get_flags(req->rq_reqmsg) & MSG_LOCK_REPLAY_DONE) { /* client declares he's ready to complete recovery * so, we put the request on th final queue */ + cfs_spin_lock(&exp->exp_lock); if (exp->exp_lock_replay_needed) { - LASSERT(cfs_atomic_read(&obd->obd_lock_replay_clients) > - 0); - cfs_spin_lock(&exp->exp_lock); exp->exp_lock_replay_needed = 0; cfs_spin_unlock(&exp->exp_lock); + LASSERT(cfs_atomic_read(&obd->obd_lock_replay_clients)); cfs_atomic_dec(&obd->obd_lock_replay_clients); + } else { + cfs_spin_unlock(&exp->exp_lock); } } return 0; -- 1.8.3.1