diff options
author | David Teigland <teigland@redhat.com> | 2007-05-29 09:44:23 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2007-07-09 03:22:52 -0400 |
commit | 84d8cd69a8e7f1c9962f46bc79850c9f1f663806 (patch) | |
tree | 4c0cedc62e7b94ba2aaa1ea9faeb7de074e08e08 /fs/dlm/lock.c | |
parent | b3cab7b9a34a6e65c1ca8f80fb57b256d57e8555 (diff) |
[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.c | 13 |
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) | |||
1010 | { | 1010 | { |
1011 | struct dlm_ls *ls = lkb->lkb_resource->res_ls; | 1011 | struct dlm_ls *ls = lkb->lkb_resource->res_ls; |
1012 | 1012 | ||
1013 | if (is_master_copy(lkb)) | 1013 | if (is_master_copy(lkb)) { |
1014 | lkb->lkb_timestamp = jiffies; | ||
1014 | return; | 1015 | return; |
1015 | 1016 | } | |
1016 | if (lkb->lkb_exflags & DLM_LKF_TIMEOUT) | ||
1017 | goto add_it; | ||
1018 | 1017 | ||
1019 | if (test_bit(LSFL_TIMEWARN, &ls->ls_flags) && | 1018 | if (test_bit(LSFL_TIMEWARN, &ls->ls_flags) && |
1020 | !(lkb->lkb_exflags & DLM_LKF_NODLCKWT)) { | 1019 | !(lkb->lkb_exflags & DLM_LKF_NODLCKWT)) { |
1021 | lkb->lkb_flags |= DLM_IFL_WATCH_TIMEWARN; | 1020 | lkb->lkb_flags |= DLM_IFL_WATCH_TIMEWARN; |
1022 | goto add_it; | 1021 | goto add_it; |
1023 | } | 1022 | } |
1023 | if (lkb->lkb_exflags & DLM_LKF_TIMEOUT) | ||
1024 | goto add_it; | ||
1024 | return; | 1025 | return; |
1025 | 1026 | ||
1026 | add_it: | 1027 | add_it: |
@@ -3510,8 +3511,7 @@ static void _receive_cancel_reply(struct dlm_lkb *lkb, struct dlm_message *ms) | |||
3510 | case -DLM_ECANCEL: | 3511 | case -DLM_ECANCEL: |
3511 | receive_flags_reply(lkb, ms); | 3512 | receive_flags_reply(lkb, ms); |
3512 | revert_lock_pc(r, lkb); | 3513 | revert_lock_pc(r, lkb); |
3513 | if (ms->m_result) | 3514 | queue_cast(r, lkb, -DLM_ECANCEL); |
3514 | queue_cast(r, lkb, -DLM_ECANCEL); | ||
3515 | break; | 3515 | break; |
3516 | case 0: | 3516 | case 0: |
3517 | break; | 3517 | break; |
@@ -4534,6 +4534,7 @@ void dlm_clear_proc_locks(struct dlm_ls *ls, struct dlm_user_proc *proc) | |||
4534 | lkb = del_proc_lock(ls, proc); | 4534 | lkb = del_proc_lock(ls, proc); |
4535 | if (!lkb) | 4535 | if (!lkb) |
4536 | break; | 4536 | break; |
4537 | del_timeout(lkb); | ||
4537 | if (lkb->lkb_exflags & DLM_LKF_PERSISTENT) | 4538 | if (lkb->lkb_exflags & DLM_LKF_PERSISTENT) |
4538 | orphan_proc_lock(ls, lkb); | 4539 | orphan_proc_lock(ls, lkb); |
4539 | else | 4540 | else |