1 From: Goldwyn Rodrigues <rgoldwyn@novell.com>
2 Subject: ocfs2/dlm Wait on lockres instead of erroring during cancel
6 If the DLM lock is in progress and someone issues a cancel, let the lock wait.
7 Added conditions for the process to fall through in case flag is set to
10 Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.de>
11 Signed-off-by: Mark Fasheh <mfasheh@suse.com>
14 ocfs2/dlm/dlmunlock.c | 4 ++--
15 1 file changed, 2 insertions(+), 2 deletions(-)
17 Index: fs/ocfs2/dlm/dlmunlock.c
18 ===================================================================
19 --- a/fs/ocfs2/dlm/dlmunlock.c 2009-07-30 16:02:55.000000000 +0200
20 +++ b/fs/ocfs2/dlm/dlmunlock.c 2009-08-21 18:04:03.000000000 +0200
21 @@ -122,7 +122,7 @@ static enum dlm_status dlmunlock_common(
22 * that still has AST's pending... */
23 in_use = !list_empty(&lock->ast_list);
24 spin_unlock(&dlm->ast_lock);
26 + if (in_use && !(flags & LKM_CANCEL)) {
27 mlog(ML_ERROR, "lockres %.*s: Someone is calling dlmunlock "
28 "while waiting for an ast!", res->lockname.len,
30 @@ -131,7 +131,7 @@ static enum dlm_status dlmunlock_common(
32 spin_lock(&res->spinlock);
33 if (res->state & DLM_LOCK_RES_IN_PROGRESS) {
35 + if (master_node && !(flags & LKM_CANCEL)) {
36 mlog(ML_ERROR, "lockres in progress!\n");
37 spin_unlock(&res->spinlock);