|
@@ -1260,10 +1260,15 @@ static int proc_do_uuid(ctl_table *table, int write,
|
|
|
uuid = table->data;
|
|
uuid = table->data;
|
|
|
if (!uuid) {
|
|
if (!uuid) {
|
|
|
uuid = tmp_uuid;
|
|
uuid = tmp_uuid;
|
|
|
- uuid[8] = 0;
|
|
|
|
|
- }
|
|
|
|
|
- if (uuid[8] == 0)
|
|
|
|
|
generate_random_uuid(uuid);
|
|
generate_random_uuid(uuid);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ static DEFINE_SPINLOCK(bootid_spinlock);
|
|
|
|
|
+
|
|
|
|
|
+ spin_lock(&bootid_spinlock);
|
|
|
|
|
+ if (!uuid[8])
|
|
|
|
|
+ generate_random_uuid(uuid);
|
|
|
|
|
+ spin_unlock(&bootid_spinlock);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
sprintf(buf, "%pU", uuid);
|
|
sprintf(buf, "%pU", uuid);
|
|
|
|
|
|