diff options
Diffstat (limited to 'fs/ocfs2')
-rw-r--r-- | fs/ocfs2/dlmglue.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index ef09fd20f3a5..4e97dcceaf8f 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c | |||
@@ -980,18 +980,6 @@ again: | |||
980 | goto unlock; | 980 | goto unlock; |
981 | } | 981 | } |
982 | 982 | ||
983 | if (!(lockres->l_flags & OCFS2_LOCK_ATTACHED)) { | ||
984 | /* lock has not been created yet. */ | ||
985 | spin_unlock_irqrestore(&lockres->l_lock, flags); | ||
986 | |||
987 | ret = ocfs2_lock_create(osb, lockres, LKM_NLMODE, 0); | ||
988 | if (ret < 0) { | ||
989 | mlog_errno(ret); | ||
990 | goto out; | ||
991 | } | ||
992 | goto again; | ||
993 | } | ||
994 | |||
995 | if (lockres->l_flags & OCFS2_LOCK_BLOCKED && | 983 | if (lockres->l_flags & OCFS2_LOCK_BLOCKED && |
996 | !ocfs2_may_continue_on_blocked_lock(lockres, level)) { | 984 | !ocfs2_may_continue_on_blocked_lock(lockres, level)) { |
997 | /* is the lock is currently blocked on behalf of | 985 | /* is the lock is currently blocked on behalf of |
@@ -1006,7 +994,14 @@ again: | |||
1006 | mlog(ML_ERROR, "lockres %s has action %u pending\n", | 994 | mlog(ML_ERROR, "lockres %s has action %u pending\n", |
1007 | lockres->l_name, lockres->l_action); | 995 | lockres->l_name, lockres->l_action); |
1008 | 996 | ||
1009 | lockres->l_action = OCFS2_AST_CONVERT; | 997 | if (!(lockres->l_flags & OCFS2_LOCK_ATTACHED)) { |
998 | lockres->l_action = OCFS2_AST_ATTACH; | ||
999 | lkm_flags &= ~LKM_CONVERT; | ||
1000 | } else { | ||
1001 | lockres->l_action = OCFS2_AST_CONVERT; | ||
1002 | lkm_flags |= LKM_CONVERT; | ||
1003 | } | ||
1004 | |||
1010 | lockres->l_requested = level; | 1005 | lockres->l_requested = level; |
1011 | lockres_or_flags(lockres, OCFS2_LOCK_BUSY); | 1006 | lockres_or_flags(lockres, OCFS2_LOCK_BUSY); |
1012 | spin_unlock_irqrestore(&lockres->l_lock, flags); | 1007 | spin_unlock_irqrestore(&lockres->l_lock, flags); |
@@ -1021,7 +1016,7 @@ again: | |||
1021 | status = dlmlock(osb->dlm, | 1016 | status = dlmlock(osb->dlm, |
1022 | level, | 1017 | level, |
1023 | &lockres->l_lksb, | 1018 | &lockres->l_lksb, |
1024 | lkm_flags|LKM_CONVERT, | 1019 | lkm_flags, |
1025 | lockres->l_name, | 1020 | lockres->l_name, |
1026 | OCFS2_LOCK_ID_MAX_LEN - 1, | 1021 | OCFS2_LOCK_ID_MAX_LEN - 1, |
1027 | ocfs2_locking_ast, | 1022 | ocfs2_locking_ast, |