Re: [PATCH] Driver Core patches for 2.6.10-rc1

From: Greg KH
Date: Fri Oct 22 2004 - 18:20:51 EST


ChangeSet 1.2023, 2004/10/22 15:43:17-07:00, greg@xxxxxxxxx

hotplug: prevent skips in sequence number from happening

Signed-off-by: Greg Kroah-Hartman <greg@xxxxxxxxx>


lib/kobject_uevent.c | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)


diff -Nru a/lib/kobject_uevent.c b/lib/kobject_uevent.c
--- a/lib/kobject_uevent.c 2004-10-22 15:59:34 -07:00
+++ b/lib/kobject_uevent.c 2004-10-22 15:59:34 -07:00
@@ -255,13 +255,6 @@
envp [i++] = scratch;
scratch += sprintf (scratch, "DEVPATH=%s", kobj_path) + 1;

- spin_lock(&sequence_lock);
- seq = ++hotplug_seqnum;
- spin_unlock(&sequence_lock);
-
- envp [i++] = scratch;
- scratch += sprintf(scratch, "SEQNUM=%lld", (long long)seq) + 1;
-
envp [i++] = scratch;
scratch += sprintf(scratch, "SUBSYSTEM=%s", name) + 1;

@@ -277,7 +270,15 @@
}
}

- pr_debug ("%s: %s %s %s %s %s %s %s\n", __FUNCTION__, argv[0], argv[1],
+ spin_lock(&sequence_lock);
+ seq = ++hotplug_seqnum;
+ spin_unlock(&sequence_lock);
+
+ envp [i++] = scratch;
+ scratch += sprintf(scratch, "SEQNUM=%lld", (long long)seq) + 1;
+
+ pr_debug ("%s: %s %s seq=%lld %s %s %s %s %s\n",
+ __FUNCTION__, argv[0], argv[1], (long long)seq,
envp[0], envp[1], envp[2], envp[3], envp[4]);

send_uevent(action_string, kobj_path, buffer, scratch - buffer, GFP_KERNEL);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/