diff options
-rw-r--r-- | fs/ocfs2/dlm/dlmconvert.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/ocfs2/dlm/dlmconvert.c b/fs/ocfs2/dlm/dlmconvert.c index e36d63ff1783..84de55ed865a 100644 --- a/fs/ocfs2/dlm/dlmconvert.c +++ b/fs/ocfs2/dlm/dlmconvert.c | |||
@@ -262,6 +262,7 @@ enum dlm_status dlmconvert_remote(struct dlm_ctxt *dlm, | |||
262 | struct dlm_lock *lock, int flags, int type) | 262 | struct dlm_lock *lock, int flags, int type) |
263 | { | 263 | { |
264 | enum dlm_status status; | 264 | enum dlm_status status; |
265 | u8 old_owner = res->owner; | ||
265 | 266 | ||
266 | mlog(0, "type=%d, convert_type=%d, busy=%d\n", lock->ml.type, | 267 | mlog(0, "type=%d, convert_type=%d, busy=%d\n", lock->ml.type, |
267 | lock->ml.convert_type, res->state & DLM_LOCK_RES_IN_PROGRESS); | 268 | lock->ml.convert_type, res->state & DLM_LOCK_RES_IN_PROGRESS); |
@@ -316,11 +317,19 @@ enum dlm_status dlmconvert_remote(struct dlm_ctxt *dlm, | |||
316 | spin_lock(&res->spinlock); | 317 | spin_lock(&res->spinlock); |
317 | res->state &= ~DLM_LOCK_RES_IN_PROGRESS; | 318 | res->state &= ~DLM_LOCK_RES_IN_PROGRESS; |
318 | lock->convert_pending = 0; | 319 | lock->convert_pending = 0; |
319 | /* if it failed, move it back to granted queue */ | 320 | /* if it failed, move it back to granted queue. |
321 | * if master returns DLM_NORMAL and then down before sending ast, | ||
322 | * it may have already been moved to granted queue, reset to | ||
323 | * DLM_RECOVERING and retry convert */ | ||
320 | if (status != DLM_NORMAL) { | 324 | if (status != DLM_NORMAL) { |
321 | if (status != DLM_NOTQUEUED) | 325 | if (status != DLM_NOTQUEUED) |
322 | dlm_error(status); | 326 | dlm_error(status); |
323 | dlm_revert_pending_convert(res, lock); | 327 | dlm_revert_pending_convert(res, lock); |
328 | } else if ((res->state & DLM_LOCK_RES_RECOVERING) || | ||
329 | (old_owner != res->owner)) { | ||
330 | mlog(0, "res %.*s is in recovering or has been recovered.\n", | ||
331 | res->lockname.len, res->lockname.name); | ||
332 | status = DLM_RECOVERING; | ||
324 | } | 333 | } |
325 | bail: | 334 | bail: |
326 | spin_unlock(&res->spinlock); | 335 | spin_unlock(&res->spinlock); |