This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cluster: master - GFS: Send useful information with uevent messages


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=16159fca271d026e86e0fea3dd7517d781c8b380
Commit:        16159fca271d026e86e0fea3dd7517d781c8b380
Parent:        248b15142287c002e232f5a0595d9e3ca446a31e
Author:        Steven Whitehouse <swhiteho@redhat.com>
AuthorDate:    Thu Nov 27 09:59:59 2008 +0000
Committer:     Steven Whitehouse <swhiteho@redhat.com>
CommitterDate: Thu Nov 27 09:59:59 2008 +0000

GFS: Send useful information with uevent messages

In order to distinguish between two differing uevent messages
and to avoid using the (racy) method of reading status from
sysfs in future, this adds some status information to our
uevent messages.

This patch makes the same changes as the recent GFS2 patch.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
---
 gfs-kernel/src/gfs/lock_dlm_mount.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/gfs-kernel/src/gfs/lock_dlm_mount.c b/gfs-kernel/src/gfs/lock_dlm_mount.c
index de7cc2a..ce5906a 100644
--- a/gfs-kernel/src/gfs/lock_dlm_mount.c
+++ b/gfs-kernel/src/gfs/lock_dlm_mount.c
@@ -195,17 +195,25 @@ out:
 static void gdlm_recovery_done(void *lockspace, unsigned int jid,
                                unsigned int message)
 {
+	char env_jid[20];
+	char env_status[20];
+	char *envp[] = { env_jid, env_status, NULL };
 	struct gdlm_ls *ls = lockspace;
 	ls->recover_jid_done = jid;
 	ls->recover_jid_status = message;
-	kobject_uevent(&ls->kobj, KOBJ_CHANGE);
+	sprintf(env_jid, "JID=%d", jid);
+	sprintf(env_status, "RECOVERY=%s",
+		message == LM_RD_SUCCESS ? "Done" : "Failed");
+	kobject_uevent_env(&ls->kobj, KOBJ_CHANGE, envp);
 }
 
 static void gdlm_others_may_mount(void *lockspace)
 {
+	char *message = "FIRSTMOUNT=Done";
+	char *envp[] = { message, NULL };
 	struct gdlm_ls *ls = lockspace;
 	ls->first_done = 1;
-	kobject_uevent(&ls->kobj, KOBJ_CHANGE);
+	kobject_uevent_env(&ls->kobj, KOBJ_CHANGE, envp);
 }
 
 /* Userspace gets the offline uevent, blocks new gfs locks on


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]