Re: [PATCH]2.6 test1 mm2 user.c race (?)

From: Andrew Morton (akpm@osdl.org)
Date: Mon Jul 28 2003 - 14:14:20 EST


<ffrederick@prov-liege.be> wrote:
>
> + spin_lock(&uidhash_lock);
> uid_hash_insert(&root_user, uidhashentry(0));
> + spin_unlock(&uidhash_lock);

This code runs within an initcall, so it is very unlikely that anything
will race with us here.

But SMP is up, and this code gets dropped out of memory later (the
out-of-line spinlock code doesn't get dropped though).

So yes, I'd prefer that the locking be there, if only for documentary
purposes. A /* comment */ which explains why the locking was omitted would
also be suitabe.

-
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/



This archive was generated by hypermail 2b29 : Thu Jul 31 2003 - 22:00:37 EST