diff options
Diffstat (limited to 'fs/ocfs2/dlm/dlmthread.c')
| -rw-r--r-- | fs/ocfs2/dlm/dlmthread.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/ocfs2/dlm/dlmthread.c b/fs/ocfs2/dlm/dlmthread.c index 1d6d1d22c471..e73c833fc2a1 100644 --- a/fs/ocfs2/dlm/dlmthread.c +++ b/fs/ocfs2/dlm/dlmthread.c | |||
| @@ -94,24 +94,26 @@ int __dlm_lockres_unused(struct dlm_lock_resource *res) | |||
| 94 | { | 94 | { |
| 95 | int bit; | 95 | int bit; |
| 96 | 96 | ||
| 97 | assert_spin_locked(&res->spinlock); | ||
| 98 | |||
| 97 | if (__dlm_lockres_has_locks(res)) | 99 | if (__dlm_lockres_has_locks(res)) |
| 98 | return 0; | 100 | return 0; |
| 99 | 101 | ||
| 102 | /* Locks are in the process of being created */ | ||
| 103 | if (res->inflight_locks) | ||
| 104 | return 0; | ||
| 105 | |||
| 100 | if (!list_empty(&res->dirty) || res->state & DLM_LOCK_RES_DIRTY) | 106 | if (!list_empty(&res->dirty) || res->state & DLM_LOCK_RES_DIRTY) |
| 101 | return 0; | 107 | return 0; |
| 102 | 108 | ||
| 103 | if (res->state & DLM_LOCK_RES_RECOVERING) | 109 | if (res->state & DLM_LOCK_RES_RECOVERING) |
| 104 | return 0; | 110 | return 0; |
| 105 | 111 | ||
| 112 | /* Another node has this resource with this node as the master */ | ||
| 106 | bit = find_next_bit(res->refmap, O2NM_MAX_NODES, 0); | 113 | bit = find_next_bit(res->refmap, O2NM_MAX_NODES, 0); |
| 107 | if (bit < O2NM_MAX_NODES) | 114 | if (bit < O2NM_MAX_NODES) |
| 108 | return 0; | 115 | return 0; |
| 109 | 116 | ||
| 110 | /* | ||
| 111 | * since the bit for dlm->node_num is not set, inflight_locks better | ||
| 112 | * be zero | ||
| 113 | */ | ||
| 114 | BUG_ON(res->inflight_locks != 0); | ||
| 115 | return 1; | 117 | return 1; |
| 116 | } | 118 | } |
| 117 | 119 | ||
| @@ -185,8 +187,6 @@ static void dlm_purge_lockres(struct dlm_ctxt *dlm, | |||
| 185 | /* clear our bit from the master's refmap, ignore errors */ | 187 | /* clear our bit from the master's refmap, ignore errors */ |
| 186 | ret = dlm_drop_lockres_ref(dlm, res); | 188 | ret = dlm_drop_lockres_ref(dlm, res); |
| 187 | if (ret < 0) { | 189 | if (ret < 0) { |
| 188 | mlog(ML_ERROR, "%s: deref %.*s failed %d\n", dlm->name, | ||
| 189 | res->lockname.len, res->lockname.name, ret); | ||
| 190 | if (!dlm_is_host_down(ret)) | 190 | if (!dlm_is_host_down(ret)) |
| 191 | BUG(); | 191 | BUG(); |
| 192 | } | 192 | } |
| @@ -209,7 +209,7 @@ static void dlm_purge_lockres(struct dlm_ctxt *dlm, | |||
| 209 | BUG(); | 209 | BUG(); |
| 210 | } | 210 | } |
| 211 | 211 | ||
| 212 | __dlm_unhash_lockres(res); | 212 | __dlm_unhash_lockres(dlm, res); |
| 213 | 213 | ||
| 214 | /* lockres is not in the hash now. drop the flag and wake up | 214 | /* lockres is not in the hash now. drop the flag and wake up |
| 215 | * any processes waiting in dlm_get_lock_resource. */ | 215 | * any processes waiting in dlm_get_lock_resource. */ |
