Re: [RFC,PATCH] use rcu for fasync_lock

From: Linus Torvalds
Date: Sun Dec 21 2003 - 15:53:11 EST




On Sun, 21 Dec 2003, Manfred Spraul wrote:
>
> Initially I tried to keep the patch as tiny as possible, thus I avoided
> adding an inline function. But Stephen Hemminger convinced me to update
> the network code, and thus it didn't matter and I've switched to an
> inline function.
> What do you think about the attached patch?

Please, NO!

Stuff like this

- write_lock_irq(&fasync_lock);
+ if (s)
+ lock_sock(s);
+ else
+ spin_lock(&fasync_lock);
+

should not be allowed. That's especially true since the choice really is a
static one depending on the caller.

Just make the caller do the locking.

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