summaryrefslogtreecommitdiff
path: root/fs/ocfs2/dlm
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2015-05-12 10:13:41 +0200
committerLinus Walleij <linus.walleij@linaro.org>2015-05-12 10:13:41 +0200
commit8becdc18c3e1f855cae5af266f6a1f5ce5af24fb (patch)
treec42e2d4274b1aa17a7822385535ac8524e4a6822 /fs/ocfs2/dlm
parent3c1b5c9bd991d1c023f736b0187582aae8a5b30a (diff)
parent030bbdbf4c833bc69f502eae58498bc5572db736 (diff)
Merge tag 'v4.1-rc3' into devel
Linux 4.1-rc3
Diffstat (limited to 'fs/ocfs2/dlm')
-rw-r--r--fs/ocfs2/dlm/dlmmaster.c13
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:
if (tmpres) {
spin_unlock(&dlm->spinlock);
spin_lock(&tmpres->spinlock);
+
+ /*
+ * Right after dlm spinlock was released, dlm_thread could have
+ * purged the lockres. Check if lockres got unhashed. If so
+ * start over.
+ */
+ if (hlist_unhashed(&tmpres->hash_node)) {
+ spin_unlock(&tmpres->spinlock);
+ dlm_lockres_put(tmpres);
+ tmpres = NULL;
+ goto lookup;
+ }
+
/* Wait on the thread that is mastering the resource */
if (tmpres->owner == DLM_LOCK_RES_OWNER_UNKNOWN) {
__dlm_wait_on_lockres(tmpres);