lkml.org 
[lkml]   [2003]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH]2.6 test1 mm2 user.c race (?)
From
Date
Andrew,

Trivial patch against possible smp race (?) in user.c
or do we have bkl above ?

Regards,
Fabian

diff -Naur orig/kernel/user.c edited/kernel/user.c
--- orig/kernel/user.c 2003-07-14 05:32:42.000000000 +0200
+++ edited/kernel/user.c 2003-07-28 13:44:55.000000000 +0200
@@ -146,8 +146,11 @@
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;
}


___________________________________


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

\
 
 \ /
  Last update: 2005-03-22 13:47    [W:0.022 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site