linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Collins <ben.collins@ubuntu.com>
To: john stultz <johnstul@us.ibm.com>
Cc: Jens Axboe <axboe@suse.de>, lkml <linux-kernel@vger.kernel.org>,
	greg@kroah.com
Subject: Re: [PATCH] block: Better CDROMEJECT
Date: Tue, 20 Dec 2005 15:55:36 -0500	[thread overview]
Message-ID: <1135112136.16754.31.camel@localhost.localdomain> (raw)
In-Reply-To: <1135111300.27117.41.camel@cog.beaverton.ibm.com>

On Tue, 2005-12-20 at 12:41 -0800, john stultz wrote:
> On Tue, 2005-12-20 at 09:07 -0500, Ben Collins wrote:
> > On Tue, 2005-12-20 at 14:39 +0100, Jens Axboe wrote:
> > > > Should be an easy check to add. In fact, I'll resend both patches with
> > > > that in place if you want.
> > > 
> > > There's still the quirky problem of forcing a locked tray out. In some
> > > cases this is what you want, if things get stuck for some reason or
> > > another. But usually the tray is locked for a good reason, because there
> > > are active users of the device.
> > > 
> > > Say two processes has the cdrom open, one of them doing io (maybe even
> > > writing!), the other could do a CDROMEJECT now and force the ejection of
> > > a busy drive.
> > 
> > But that's possible now with "eject -s" as long as you have write access
> > to it. Most users are using "eject -s" anyway.
> > 
> > You can't stop this from happening. However, the fact is that a lot of
> > devices (iPod's being the most popular) require this to work.
> 
> I'm a little confused. Eject has a number of different ways it
> interfaces with the kernel (scsi, cdrom, floppy, tape), which I assume
> map to different ioctl commands. In the case I'm familiar with (my usb
> ipod, and my firewire disk), the scsi method (via eject -s) is used
> which sends a ALLOW_MEDIUM_REMOVAL.
> 
> Now I know without passing a specific method, eject will try different
> methods until one works, but it seems that the patch below is overriding
> the CDROMEJECT ioctl so that it then sends an ALLOW_MEDIUM_REMOVAL as
> well as the normal GPCMD_START_STOP_UNIT.

These are MMC commands, not specific to the bus it is sitting on (be it
scsi, IDE, USB, or firewire).

The "scsi" method in eject has been using pretty much the same code path
in the kernel as CDROMEJECT for some time (probably since Linus did the
whole SG_IO thing to make burning to IDE devices without ide-scsi
possible).

In fact, one user affected by the bug I was trying to fix had an IDE
CDROM drive that would only eject with "eject -s". The "eject -s" being
"Scsi Eject" in the eject program is a misnomer really.

-- 
   Ben Collins <ben.collins@ubuntu.com>
   Developer
   Ubuntu Linux


  parent reply	other threads:[~2005-12-20 20:55 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-20  2:51 [RFC] Let non-root users eject their ipods? john stultz
2005-12-20  3:51 ` Wakko Warner
2005-12-20  3:49   ` john stultz
2005-12-20  5:05     ` Matthew Dharm
2005-12-24 21:16   ` Jan Engelhardt
2005-12-20  5:18 ` Willy Tarreau
2005-12-20  6:06   ` Coywolf Qi Hunt
2005-12-20  8:56     ` Sander
2005-12-20  9:31       ` Coywolf Qi Hunt
2005-12-20  9:38         ` Sander
2005-12-20 16:39           ` Bill Davidsen
2005-12-20 11:10         ` Nikita Danilov
2005-12-20  7:46 ` Jens Axboe
2005-12-20 12:41   ` Ben Collins
2005-12-20 13:28     ` Jens Axboe
2005-12-20 13:32       ` Ben Collins
2005-12-20 13:39         ` Jens Axboe
2005-12-20 14:07           ` [PATCH] block: Better CDROMEJECT Ben Collins
2005-12-20 14:16             ` Jens Axboe
2005-12-20 20:41             ` john stultz
2005-12-20 20:54               ` Jens Axboe
2005-12-20 20:55                 ` john stultz
2005-12-20 20:58                   ` Jens Axboe
2005-12-20 20:58                     ` john stultz
2005-12-20 20:55               ` Ben Collins [this message]
2005-12-20 16:48           ` [RFC] Let non-root users eject their ipods? Bill Davidsen
2005-12-22 10:56 ` Alan Cox
2005-12-22 16:57   ` john stultz
2005-12-24 21:17   ` 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=1135112136.16754.31.camel@localhost.localdomain \
    --to=ben.collins@ubuntu.com \
    --cc=axboe@suse.de \
    --cc=greg@kroah.com \
    --cc=johnstul@us.ibm.com \
    --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;
as well as URLs for NNTP newsgroup(s).