diff options
| -rw-r--r-- | fs/ocfs2/dlm/dlmmaster.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c index a6944b25fd5b..fdf4b41d0609 100644 --- a/fs/ocfs2/dlm/dlmmaster.c +++ b/fs/ocfs2/dlm/dlmmaster.c | |||
| @@ -757,6 +757,19 @@ lookup: | |||
| 757 | if (tmpres) { | 757 | if (tmpres) { |
| 758 | spin_unlock(&dlm->spinlock); | 758 | spin_unlock(&dlm->spinlock); |
| 759 | spin_lock(&tmpres->spinlock); | 759 | spin_lock(&tmpres->spinlock); |
| 760 | |||
| 761 | /* | ||
| 762 | * Right after dlm spinlock was released, dlm_thread could have | ||
| 763 | * purged the lockres. Check if lockres got unhashed. If so | ||
| 764 | * start over. | ||
| 765 | */ | ||
| 766 | if (hlist_unhashed(&tmpres->hash_node)) { | ||
| 767 | spin_unlock(&tmpres->spinlock); | ||
| 768 | dlm_lockres_put(tmpres); | ||
| 769 | tmpres = NULL; | ||
| 770 | goto lookup; | ||
| 771 | } | ||
| 772 | |||
| 760 | /* Wait on the thread that is mastering the resource */ | 773 | /* Wait on the thread that is mastering the resource */ |
| 761 | if (tmpres->owner == DLM_LOCK_RES_OWNER_UNKNOWN) { | 774 | if (tmpres->owner == DLM_LOCK_RES_OWNER_UNKNOWN) { |
| 762 | __dlm_wait_on_lockres(tmpres); | 775 | __dlm_wait_on_lockres(tmpres); |
