lkml.org 
[lkml]   [2001]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Remove needless BKL from release functions
Christoph Hellwig wrote:

>Beeing completly single-threaded also simplifies writing unclean drivers..
>
>BTW, I've attached a patch that fixes the largest input races (against 2.4.6),
>I don't see how to change the total lack of locking for other data structures
>without an API change, though.
>
The removal of the BKL in the input.c's open() was beyond the scope of
what we were trying to do. But, it snuck into the patch anyway. It
probably shouldn't have been there.

In the patch, in the open function, you do this:
if (handler)
new_fops = fops_get(handler->fops);

But, the fops_get() #define already cheecks to make sure handler isn't null:
#define fops_get(fops) \
(((fops) && (fops)->owner) \
? ( try_inc_mod_count((fops)->owner) ? (fops) : NULL ) \
: (fops))

It's nice to be careful, but is that extra check really necessary?

And, the BKL is still held during the open() call to the handler's
open(). Is this trying to make sure that open() isn't called twice on a
single device? I checked all of the files in drivers/input, and didn't
see any other uses of the BKL.

--
David C. Hansen
haveblue@us.ibm.com

-
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:18    [W:0.079 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site