From: <ffrederick@prov-liege.be>
Add the necessary locking around uid_hash_insert() in uid_cache_init().
(It's an initcall, and the chances of another CPU racing with us here are
basically zero. But it's good for documentary purposes and the code gets
dropped later anyway...)
for(n = 0; n < UIDHASH_SZ; ++n)
INIT_LIST_HEAD(uidhash_table + n);
- /* Insert the root user immediately - init already runs with this */
+ /* Insert the root user immediately (init already runs as root) */
+ spin_lock(&uidhash_lock);
uid_hash_insert(&root_user, uidhashentry(0));
+ spin_unlock(&uidhash_lock);
+
return 0;
}