ChangeSet 1.2023, 2004/10/22 15:43:17-07:00, greg@kroah.com hotplug: prevent skips in sequence number from happening Signed-off-by: Greg Kroah-Hartman 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);