mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eduard Bloch <edi@gmx.de>
To: linux-kernel@vger.kernel.org, debburn-devel@lists.alioth.debian.org
Subject: Re: broken device locking, sg vs. sg_io on block devices
Date: Fri, 30 Mar 2007 16:21:14 +0200	[thread overview]
Message-ID: <20070330142114.GA31685@rotes76.wohnheim.uni-kl.de> (raw)
In-Reply-To: <20070330134327.GA24030@infradead.org>

#include <hallo.h>
* Christoph Hellwig [Fri, Mar 30 2007, 02:43:27PM]:

> > Long story:
> > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=413960
> > https://bugzilla.novell.com/show_bug.cgi?id=226019
> > http://lists.alioth.debian.org/pipermail/debburn-devel/2007-February/000297.html
> > and other error messages.
> > 
> > There is AFAICS no simple way to establish locking across the driver
> > borders. If kernel developers have a good idea, any help is appreciated.
> > 
> > Below are the typical symptoms: wodim operates via /dev/sgX because the
> > user chosen it this way, some other process (most likely hald) comes
> > along and reads from /dev/sr0 and the drive gets confused. Boom.
> 
> You have thre problems here, and none of them are in the kernel :)
> 
> First the hardsware is broken when it can't deal with concurrent requests,
> I'd try to get a refund for it.  Second wodim should never ever use
> /dev/sg if the sr node is available.  And third HAL should stop poking
> devices all the time.  Then again hald is a totally lost cause and
> I can only recommend to uninstall it ASAP.

Then make /dev/sg* unusable when something opens /dev/sr. Please.
Otherwise it is just another assumption of how things might or should
work, not really matching the use cases in the wild. And here are
some real world facts:

 - there is a fixed mapping between the fake-SCSI numbers and devices
   established by Schilling. People are using it, it is hardcoded into
   frontend applications. We cannot change that overnight without
   breaking even more stuff.
   
   If there is a simple way to get the mapping between the sg and sr
   devices that would be great and almost solve the problems, but I
   cannot discover a such thing in the kernel.

 - hald is using O_EXCL already, as wodim does, and this seems to work
   well as long as they are acting on the same virtual devices.

 - hald is installed together with KDE. Do you suggest to remove KDE as
   well? I don't think so.

 - of course the hardware does not handle concurent requests, it is
   designed that way. It is burden of kernel to canalize the access and
   deal with concurrency issues. Obviously the kernel can and shall not
   do all the work but at least the basic safety mechanisms must work
   reliably and currently they don't.

Eduard.
-- 
<LGS> Halloechen, ihr Spinner, so frueh auf?
<nusse> nein, wir schlafen alle im kollektiv
<knorke> mein alkoven ist kaputt
<teq> alkohol kaputt?

  reply	other threads:[~2007-03-30 14:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200703261811.21448.gerald@itzgrund.net>
2007-03-30 11:17 ` Eduard Bloch
2007-03-30 13:43   ` Christoph Hellwig
2007-03-30 14:21     ` Eduard Bloch [this message]
2007-03-30 18:10       ` Alan Cox
2007-03-31 17:07         ` Eduard Bloch
2007-03-31 22:20           ` Alan Cox
2007-03-31 22:40             ` Eduard Bloch
2007-04-01  0:14               ` Alan Cox
2007-04-01  2:34                 ` Oleg Verych
2007-04-07 11:21             ` Eduard Bloch
2007-04-11 10:12               ` Eduard Bloch
2007-04-11 11:31                 ` Alan Cox
2007-04-11 12:19                   ` Eduard Bloch
2007-03-30 19:09       ` Jan Engelhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070330142114.GA31685@rotes76.wohnheim.uni-kl.de \
    --to=edi@gmx.de \
    --cc=debburn-devel@lists.alioth.debian.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®