aboutsummaryrefslogtreecommitdiff
path: root/fs/ocfs2/cluster/heartbeat.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/cluster/heartbeat.c')
-rw-r--r--fs/ocfs2/cluster/heartbeat.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c
index e331f4cb2c8..2877d468f11 100644
--- a/fs/ocfs2/cluster/heartbeat.c
+++ b/fs/ocfs2/cluster/heartbeat.c
@@ -1693,9 +1693,18 @@ static int o2hb_region_get(const char *region_uuid)
ret = -ENOENT;
spin_unlock(&o2hb_live_lock);
- if (!ret)
- ret = o2nm_depend_item(&reg->hr_item);
+ if (ret)
+ goto out;
+
+ ret = o2nm_depend_this_node();
+ if (ret)
+ goto out;
+ ret = o2nm_depend_item(&reg->hr_item);
+ if (ret)
+ o2nm_undepend_this_node();
+
+out:
return ret;
}
@@ -1709,8 +1718,10 @@ static void o2hb_region_put(const char *region_uuid)
spin_unlock(&o2hb_live_lock);
- if (reg)
+ if (reg) {
o2nm_undepend_item(&reg->hr_item);
+ o2nm_undepend_this_node();
+ }
}
int o2hb_register_callback(const char *region_uuid,