[lkml]   [2001]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: brlock_is_locked()?
   From: Brad Chapman <>
Date: Wed, 22 Aug 2001 11:17:55 -0700 (PDT)

At this section of the code, it doesn't really matter who in the
netfilter/network stack has BR_NETPROTO_LOCK, just that we need to know if
it's already locked by someone else, or unlocked for us to use. Is what I'm
asking for physically possible?

As a reader, the BR_NETPROTO_LOCK nests. So no deadlock.

If the situation involves a writer, you must make sure that locking
rules are well defined and abided by. No matter what you do, if you
try to conditionalize locking by testing if the lock is held, another
SMP can always get in there after you check it and corrupt your data.
The lock is basically pointless if you start testing it's locked

Basically, "fix your code" ;-)

It's often easy to do this. If you have two paths, one which is going
to already have the lock and one which won't, just make two functions
like so:

void __func(void)

void func(void)

I don't see why this is such a big problem.

David S. Miller
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

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