summaryrefslogtreecommitdiffstats
path: root/fs/dlm/lock.c
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2007-05-29 08:44:23 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2007-07-09 08:22:52 +0100
commit84d8cd69a8e7f1c9962f46bc79850c9f1f663806 (patch)
tree4c0cedc62e7b94ba2aaa1ea9faeb7de074e08e08 /fs/dlm/lock.c
parentb3cab7b9a34a6e65c1ca8f80fb57b256d57e8555 (diff)
downloadlinux-84d8cd69a8e7f1c9962f46bc79850c9f1f663806.tar.gz
linux-84d8cd69a8e7f1c9962f46bc79850c9f1f663806.tar.bz2
linux-84d8cd69a8e7f1c9962f46bc79850c9f1f663806.zip
[DLM] timeout fixes
Various fixes related to the new timeout feature: - add_timeout() missed setting TIMEWARN flag on lkb's when the TIMEOUT flag was already set - clear_proc_locks should remove a dead process's locks from the timeout list - the end-of-life calculation for user locks needs to consider that ETIMEDOUT is equivalent to -DLM_ECANCEL - make initial default timewarn_cs config value visible in configfs - change bit position of TIMEOUT_CANCEL flag so it's not copied to a remote master node - set timestamp on remote lkb's so a lock dump will display the time they've been waiting Signed-off-by: David Teigland <teigland@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/dlm/lock.c')
-rw-r--r--fs/dlm/lock.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
index 2f8a5a700cc0..df91578145d1 100644
--- a/fs/dlm/lock.c
+++ b/fs/dlm/lock.c
@@ -1010,17 +1010,18 @@ static void add_timeout(struct dlm_lkb *lkb)
{
struct dlm_ls *ls = lkb->lkb_resource->res_ls;
- if (is_master_copy(lkb))
+ if (is_master_copy(lkb)) {
+ lkb->lkb_timestamp = jiffies;
return;
-
- if (lkb->lkb_exflags & DLM_LKF_TIMEOUT)
- goto add_it;
+ }
if (test_bit(LSFL_TIMEWARN, &ls->ls_flags) &&
!(lkb->lkb_exflags & DLM_LKF_NODLCKWT)) {
lkb->lkb_flags |= DLM_IFL_WATCH_TIMEWARN;
goto add_it;
}
+ if (lkb->lkb_exflags & DLM_LKF_TIMEOUT)
+ goto add_it;
return;
add_it:
@@ -3510,8 +3511,7 @@ static void _receive_cancel_reply(struct dlm_lkb *lkb, struct dlm_message *ms)
case -DLM_ECANCEL:
receive_flags_reply(lkb, ms);
revert_lock_pc(r, lkb);
- if (ms->m_result)
- queue_cast(r, lkb, -DLM_ECANCEL);
+ queue_cast(r, lkb, -DLM_ECANCEL);
break;
case 0:
break;
@@ -4534,6 +4534,7 @@ void dlm_clear_proc_locks(struct dlm_ls *ls, struct dlm_user_proc *proc)
lkb = del_proc_lock(ls, proc);
if (!lkb)
break;
+ del_timeout(lkb);
if (lkb->lkb_exflags & DLM_LKF_PERSISTENT)
orphan_proc_lock(ls, lkb);
else