[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <11727.1211139999@vena.lwn.net>
Date: Sun, 18 May 2008 13:46:39 -0600
From: corbet@....net (Jonathan Corbet)
To: Alan Cox <alan@...rguk.ukuu.org.uk>
Cc: Jonathan Corbet <corbet@....net>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Ingo Molnar <mingo@...e.hu>,
Andrew Morton <akpm@...ux-foundation.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Thomas Gleixner <tglx@...utronix.de>,
Alexander Viro <viro@....linux.org.uk>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kill empty chardev open/release methods
Alan Cox <alan@...rguk.ukuu.org.uk> wrote:
> Actually it turns out you can introduce bugs doing this when the BKL is
> pushed down.
>
> The problem is the methods are not NULL, they (with the lock pushed down
> are)
>
> {
> lock_kernel();
> unlock_kernel();
> }
>
> And we have drivers with setup code that does things in the wrong order
> but under the BKL. eg one I just fixed did
>
> misc_register()
> init locks
> allocate memory
> do stuff
> return 0;
Hmph.
As it turns out, a misc driver will still be OK because the BKL has not
(yet) been pushed past misc_open(). What this does mean, though, is
that all of those empty and trivial open functions need to be
revisited. I thought this looked too easy the first time through...
jon
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists