lkml.org 
[lkml]   [2010]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/6] procfs: Push down the bkl from ioctl
On Tue, Mar 30, 2010 at 08:54:11PM +0200, Arnd Bergmann wrote:
> On Tuesday 30 March 2010 20:27:12 Frederic Weisbecker wrote:
> > On Tue, Mar 30, 2010 at 11:37:27AM +0100, Arnd Bergmann wrote:
> > > On Tuesday 30 March 2010, Frederic Weisbecker wrote:
> > > > Push down the bkl from procfs's ioctl main handler to its users.
> > > > Only three procfs users implement an ioctl (non unlocked) handler.
> > > > Turn them into unlocked_ioctl and push down the Devil inside.
> > >
> > > Looks good to me. I would have used a single unlock and return statement
> > > in i8k_ioctl and isdn_divert_ioctl, with goto instead of adding an
> > > unlock to each return, but it doesn't matter much.
> >
> >
> > I did that first, but actually that didn't make much difference:
> >
> > ret = foo; unlock_kernel()
> > goto end; VS return foo;
>
> Yes, the amount of code needed is comparable, but it is much easier
> to validate that you did not miss an unlock when you know that there
> is a single return statement in the function. It also helps the next
> person that may want to replace the BKL with a different lock.


Ah you're right!



\
 
 \ /
  Last update: 2010-03-30 21:23    [W:0.068 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site