aboutsummaryrefslogtreecommitdiffstats
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 e331f4cb2c81..2877d468f115 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)
1693 ret = -ENOENT; 1693 ret = -ENOENT;
1694 spin_unlock(&o2hb_live_lock); 1694 spin_unlock(&o2hb_live_lock);
1695 1695
1696 if (!ret) 1696 if (ret)
1697 ret = o2nm_depend_item(&reg->hr_item); 1697 goto out;
1698
1699 ret = o2nm_depend_this_node();
1700 if (ret)
1701 goto out;
1698 1702
1703 ret = o2nm_depend_item(&reg->hr_item);
1704 if (ret)
1705 o2nm_undepend_this_node();
1706
1707out:
1699 return ret; 1708 return ret;
1700} 1709}
1701 1710
@@ -1709,8 +1718,10 @@ static void o2hb_region_put(const char *region_uuid)
1709 1718
1710 spin_unlock(&o2hb_live_lock); 1719 spin_unlock(&o2hb_live_lock);
1711 1720
1712 if (reg) 1721 if (reg) {
1713 o2nm_undepend_item(&reg->hr_item); 1722 o2nm_undepend_item(&reg->hr_item);
1723 o2nm_undepend_this_node();
1724 }
1714} 1725}
1715 1726
1716int o2hb_register_callback(const char *region_uuid, 1727int o2hb_register_callback(const char *region_uuid,