mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [patch] char/raw.c locking on error
@ 2009-03-27 10:28 Dan Carpenter
  2009-03-27 15:48 ` Jonathan Corbet
  0 siblings, 1 reply; 6+ messages in thread
From: Dan Carpenter @ 2009-03-27 10:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: eteo

There is an unlock_kernel missing.

This bug was found by smatch (http://repo.or.cz/w/smatch.git/).  Compile 
tested only, sorry.

regards,
dan carpenter

Signed-off-by: Dan Carpenter <error27@gmail.com>

--- orig/drivers/char/raw.c	2009-03-26 22:40:27.000000000 +0300
+++ devel/drivers/char/raw.c	2009-03-26 22:41:20.000000000 +0300
@@ -90,6 +90,7 @@
 	blkdev_put(bdev, filp->f_mode);
 out:
 	mutex_unlock(&raw_mutex);
+	unlock_kernel();
 	return err;
 }
 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] char/raw.c locking on error
  2009-03-27 10:28 [patch] char/raw.c locking on error Dan Carpenter
@ 2009-03-27 15:48 ` Jonathan Corbet
  2009-03-27 21:36   ` Michael Tokarev
  0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Corbet @ 2009-03-27 15:48 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-kernel, eteo

On Fri, 27 Mar 2009 13:28:48 +0300 (EAT)
Dan Carpenter <error27@gmail.com> wrote:

> This bug was found by smatch (http://repo.or.cz/w/smatch.git/).  Compile 
> tested only, sorry.

But clearly correct.  This is probably my fault, duh.  I've grabbed the
fix into the bkl-removal tree in case it doesn't get in via some faster
path.

(I bet raw doesn't need BKL at all; I'll see if I can't find some time
to have a look later on).

Thanks,

jon

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] char/raw.c locking on error
  2009-03-27 15:48 ` Jonathan Corbet
@ 2009-03-27 21:36   ` Michael Tokarev
  2009-03-27 21:44     ` Jonathan Corbet
  2009-03-28  0:23     ` Alan Cox
  0 siblings, 2 replies; 6+ messages in thread
From: Michael Tokarev @ 2009-03-27 21:36 UTC (permalink / raw)
  To: Jonathan Corbet; +Cc: Dan Carpenter, linux-kernel, eteo

Jonathan Corbet wrote:
> (I bet raw doesn't need BKL at all; I'll see if I can't find some time
> to have a look later on).

Is it still in use - the raw driver, that is?  Nowadays,
every block device can be opened in direct mode by using
O_DIRECT - this is what raw does.  I mean, is it worth
spending even more time on it?

/mjt

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] char/raw.c locking on error
  2009-03-27 21:36   ` Michael Tokarev
@ 2009-03-27 21:44     ` Jonathan Corbet
  2009-03-28  0:23     ` Alan Cox
  1 sibling, 0 replies; 6+ messages in thread
From: Jonathan Corbet @ 2009-03-27 21:44 UTC (permalink / raw)
  To: Michael Tokarev; +Cc: Dan Carpenter, linux-kernel, eteo

On Sat, 28 Mar 2009 00:36:08 +0300
Michael Tokarev <mjt@tls.msk.ru> wrote:

> Is it still in use - the raw driver, that is?  Nowadays,
> every block device can be opened in direct mode by using
> O_DIRECT - this is what raw does.  I mean, is it worth
> spending even more time on it?

This was discussed a while back.  My understanding is that there are
people using it.  It is a user-space ABI of sorts which can't just be
yanked arbitrarily.  The right thing to do is probably to replace it
with a shell implementation that just opens the device using O_DIRECT,
but nobody has actually done that...

jon

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] char/raw.c locking on error
  2009-03-27 21:36   ` Michael Tokarev
  2009-03-27 21:44     ` Jonathan Corbet
@ 2009-03-28  0:23     ` Alan Cox
  1 sibling, 0 replies; 6+ messages in thread
From: Alan Cox @ 2009-03-28  0:23 UTC (permalink / raw)
  To: Michael Tokarev; +Cc: Jonathan Corbet, Dan Carpenter, linux-kernel, eteo

On Sat, 28 Mar 2009 00:36:08 +0300
Michael Tokarev <mjt@tls.msk.ru> wrote:

> Jonathan Corbet wrote:
> > (I bet raw doesn't need BKL at all; I'll see if I can't find some time
> > to have a look later on).
> 
> Is it still in use - the raw driver, that is?  Nowadays,
> every block device can be opened in direct mode by using
> O_DIRECT - this is what raw does.  I mean, is it worth
> spending even more time on it?

Certainly when I worked for a vendor there were some big proprietary
applications using the raw interface both because it was an established
API and also because it mirrorred various Unixen and relatives they also
ran the apps on with the same basic code.

Attempts to kill it were met with pretty forceful objections.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] char/raw.c locking on error
       [not found]     ` <cks6g-7wu-13@gated-at.bofh.it>
@ 2009-03-27 23:49       ` Bodo Eggert
  0 siblings, 0 replies; 6+ messages in thread
From: Bodo Eggert @ 2009-03-27 23:49 UTC (permalink / raw)
  To: Jonathan Corbet, Michael Tokarev, Dan Carpenter, linux-kernel, eteo

Jonathan Corbet <corbet@lwn.net> wrote:
> Michael Tokarev <mjt@tls.msk.ru> wrote:

>> Is it still in use - the raw driver, that is?  Nowadays,
>> every block device can be opened in direct mode by using
>> O_DIRECT - this is what raw does.  I mean, is it worth
>> spending even more time on it?

As long as you don't fix all the legacy applications to use O_DIRECT.

> This was discussed a while back.  My understanding is that there are
> people using it.  It is a user-space ABI of sorts which can't just be
> yanked arbitrarily.  The right thing to do is probably to replace it
> with a shell implementation that just opens the device using O_DIRECT,
> but nobody has actually done that...

It had long been done when before it was discussed the last time.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-03-28  0:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-27 10:28 [patch] char/raw.c locking on error Dan Carpenter
2009-03-27 15:48 ` Jonathan Corbet
2009-03-27 21:36   ` Michael Tokarev
2009-03-27 21:44     ` Jonathan Corbet
2009-03-28  0:23     ` Alan Cox
     [not found] <ckhDP-7Ey-1@gated-at.bofh.it>
     [not found] ` <ckmtX-6ZA-25@gated-at.bofh.it>
     [not found]   ` <ckrWP-7iQ-33@gated-at.bofh.it>
     [not found]     ` <cks6g-7wu-13@gated-at.bofh.it>
2009-03-27 23:49       ` Bodo Eggert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®