[Ocfs2-tools-devel] [PATCH 8/9] ocfs2_controld: De-register all filesystems on exit.

Joel Becker joel.becker at oracle.com
Wed Aug 13 17:15:38 PDT 2008


If we're exiting uncleanly, we'll have a list of registered filesystems.
Send fire-and-forget unregister events to dlm_controld.

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

diff --git a/ocfs2_controld/dlmcontrol.c b/ocfs2_controld/dlmcontrol.c
index 7a4214d..889f138 100644
--- a/ocfs2_controld/dlmcontrol.c
+++ b/ocfs2_controld/dlmcontrol.c
@@ -134,6 +134,18 @@ out:
 	return rc;
 }
 
+static void dlmcontrol_unregister_all(void)
+{
+	struct list_head *pos, *n;
+	struct dlmcontrol_fs *df;
+
+	list_for_each_safe(pos, n, &register_list) {
+		df = list_entry(pos, struct dlmcontrol_fs, df_list);
+		/* This is exit-time, don't care about errors */
+		dlmcontrol_unregister(df->df_name);
+	}
+}
+
 static void dead_dlmcontrol(int ci)
 {
 	if (ci != dlmcontrol_ci) {
@@ -229,6 +241,7 @@ void exit_dlmcontrol(void)
 	if (dlmcontrol_fd < 0)
 		return;
 
+	dlmcontrol_unregister_all();
 	log_debug("Closing dlm_controld connection");
 	dlmc_fs_disconnect(dlmcontrol_fd);
 }
-- 
1.5.6.3




More information about the Ocfs2-tools-devel mailing list