[Ocfs2-tools-devel] [PATCH] ocfs2_hb_ctl: Honor errors from ocfs2_fill_heartbeat_desc().

Joel Becker Joel.Becker at oracle.com
Wed Dec 3 13:20:55 PST 2008


When I added the cluster descriptor to ocfs2_hb_ctl, I lost the error
return from calling ocfs2_fill_heartbeat_desc() in get_desc().  Jump out
of the function when the error happens.

This is bugzilla #1053.

Signed-off-by: Joel Becker <joel.becker at oracle.com>
---
 ocfs2_hb_ctl/ocfs2_hb_ctl.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/ocfs2_hb_ctl/ocfs2_hb_ctl.c b/ocfs2_hb_ctl/ocfs2_hb_ctl.c
index 27c10f0..3fe45ed 100644
--- a/ocfs2_hb_ctl/ocfs2_hb_ctl.c
+++ b/ocfs2_hb_ctl/ocfs2_hb_ctl.c
@@ -139,6 +139,7 @@ static errcode_t get_desc(const char *dev)
 	} else {
 		region_desc->r_name = NULL;
 		region_desc->r_device_name = NULL;
+		goto out_close;
 	}
 
 	err = ocfs2_fill_cluster_desc(fs, cluster_desc);
@@ -160,6 +161,7 @@ static errcode_t get_desc(const char *dev)
 		cluster_desc->c_cluster = NULL;
 	}
 
+out_close:
 	ocfs2_close(fs);
 
 out:
-- 
1.5.6.5

-- 

Life's Little Instruction Book #207

	"Swing for the fence."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



More information about the Ocfs2-tools-devel mailing list