linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: swhiteho@redhat.com
To: linux-kernel@vger.kernel.org, cluster-devel@redhat.com
Cc: Steven Whitehouse <swhiteho@redhat.com>
Subject: [PATCH 23/24] GFS2: Send useful information with uevent messages
Date: Wed, 17 Dec 2008 11:30:22 +0000	[thread overview]
Message-ID: <1229513423-19105-24-git-send-email-swhiteho@redhat.com> (raw)
In-Reply-To: <1229513423-19105-23-git-send-email-swhiteho@redhat.com>

From: Steven Whitehouse <swhiteho@redhat.com>

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.

Btw, before anybody says "sysfs isn't racy", I'm aware of that,
but the way that GFS2 was using it (send an ambiugous uevent and
then expect the receiver to read sysfs to find out the status
of the reported operation) was.

The additional benefit of using the new interface is that it
should be possible for a node to recover multiple journals
at the same time, since there is no longer any confusion as
to which journal the status belongs to.

At some future stage, when all the userland programs have been
converted, I intend to remove the old interface.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

diff --git a/fs/gfs2/locking/dlm/mount.c b/fs/gfs2/locking/dlm/mount.c
index 0c4cbe6..1aa7eb6 100644
--- a/fs/gfs2/locking/dlm/mount.c
+++ b/fs/gfs2/locking/dlm/mount.c
@@ -194,17 +194,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
-- 
1.6.0.3


  reply	other threads:[~2008-12-17 12:38 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-17 11:29 GFS2: Pre-pull patch posting swhiteho
2008-12-17 11:30 ` [PATCH 01/24] GFS2: Support for FIEMAP ioctl swhiteho
2008-12-17 11:30   ` [PATCH 02/24] GFS2: Rationalise header files swhiteho
2008-12-17 11:30     ` [PATCH 03/24] GFS2: Fix up jdata writepage/delete_inode swhiteho
2008-12-17 11:30       ` [PATCH 04/24] GFS2: sparse annotation of gl->gl_spin swhiteho
2008-12-17 11:30         ` [PATCH 05/24] GFS2: Move generation number into "proper" part of inode swhiteho
2008-12-17 11:30           ` [PATCH 06/24] GFS2: Move "entries" into "proper" inode swhiteho
2008-12-17 11:30             ` [PATCH 07/24] GFS2: Move di_eattr " swhiteho
2008-12-17 11:30               ` [PATCH 08/24] GFS2: Move i_size from gfs2_dinode_host and rename it to i_disksize swhiteho
2008-12-17 11:30                 ` [PATCH 09/24] GFS2: Banish struct gfs2_dinode_host swhiteho
2008-12-17 11:30                   ` [PATCH 10/24] GFS2: Move rg_igeneration into struct gfs2_rgrpd swhiteho
2008-12-17 11:30                     ` [PATCH 11/24] GFS2: Move rg_free from gfs2_rgrpd_host to gfs2_rgrpd swhiteho
2008-12-17 11:30                       ` [PATCH 12/24] GFS2: Banish struct gfs2_rgrpd_host swhiteho
2008-12-17 11:30                         ` [PATCH 13/24] GFS2: Add more detail to debugfs glock dumps swhiteho
2008-12-17 11:30                           ` [PATCH 14/24] GFS2: Clean up & move gfs2_quotad swhiteho
2008-12-17 11:30                             ` [PATCH 15/24] GFS2: Fix "truncate in progress" hang swhiteho
2008-12-17 11:30                               ` [PATCH 16/24] GFS2: Move gfs2_recoverd into recovery.c swhiteho
2008-12-17 11:30                                 ` [PATCH 17/24] GFS2: Kill two daemons with one patch swhiteho
2008-12-17 11:30                                   ` [PATCH 18/24] GFS2: Send some sensible sysfs stuff swhiteho
2008-12-17 11:30                                     ` [PATCH 19/24] GFS2: Fix bug in gfs2_lock_fs_check_clean() swhiteho
2008-12-17 11:30                                       ` [PATCH 20/24] GFS2: Move four functions from super.c swhiteho
2008-12-17 11:30                                         ` [PATCH 21/24] GFS2: Remove ancient, unused code swhiteho
2008-12-17 11:30                                           ` [PATCH 22/24] GFS2: Fix use-after-free bug on umount swhiteho
2008-12-17 11:30                                             ` swhiteho [this message]
2008-12-17 11:30                                               ` [PATCH 24/24] GFS2: Streamline alloc calculations for writes swhiteho
2008-12-18  1:22   ` [PATCH 01/24] GFS2: Support for FIEMAP ioctl Andrew Morton
2008-12-18 10:29     ` Steven Whitehouse
2008-12-18 19:04       ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1229513423-19105-24-git-send-email-swhiteho@redhat.com \
    --to=swhiteho@redhat.com \
    --cc=cluster-devel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).