public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Ben Collins <ben.collins@ubuntu.com>,
	Ben Collins <bcollins@ubuntu.com>,
	akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2.6.15-rc6] block: Make CDROMEJECT more robust
Date: Mon, 19 Dec 2005 21:07:35 +0100	[thread overview]
Message-ID: <20051219200734.GQ3734@suse.de> (raw)
In-Reply-To: <Pine.LNX.4.64.0512191156430.4827@g5.osdl.org>

On Mon, Dec 19 2005, Linus Torvalds wrote:
> 
> 
> On Mon, 19 Dec 2005, Ben Collins wrote:
> > 
> > > >  		case CDROMEJECT:
> > > > -			rq = blk_get_request(q, WRITE, __GFP_WAIT);
> > > > -			rq->flags |= REQ_BLOCK_PC;
> > > > -			rq->data = NULL;
> > > > -			rq->data_len = 0;
> > > > -			rq->timeout = BLK_DEFAULT_TIMEOUT;
> > > > -			memset(rq->cmd, 0, sizeof(rq->cmd));
> > > > -			rq->cmd[0] = GPCMD_START_STOP_UNIT;
> > > > -			rq->cmd[4] = 0x02 + (close != 0);
> > > > -			rq->cmd_len = 6;
> > > > -			err = blk_execute_rq(q, bd_disk, rq, 0);
> > > > -			blk_put_request(rq);
> > > > +			err = 0;
> > > > +
> > > > +			err |= blk_send_allow_medium_removal(q, bd_disk);
> > > > +			err |= blk_send_start_stop(q, bd_disk, 0x01);
> > > > +			err |= blk_send_start_stop(q, bd_disk, 0x02);
> > > 
> > > Do this in the eject tool, if it's required for some devices.
> > 
> > It already is in eject tool, but as described, that requires root
> > access. Not something I want to force a user to do in order to eject
> > their CDROM/iPod/USBStick in gnome. What exactly is wrong with the
> > commands? If they are harmless for devices that don't need it, and fix a
> > huge number of problems (did you see the Cc list on the bug report?) for
> > users with affected devices, then what's the harm?
> 
> I do agree that the suggested patch seems to be a real cleanup, regardless 
> of whether the original code bug has now been fixed or not.

Apparently two seperate issues.

> 
> Are there devices that really want the old sequence? 
> 
> Also, do we really need to send fist a start_stop 1 and then a 2?

The 0x01 looks really suspicious to me, it should just cause extra wait
and activity on most devices.

> Wouldn't the _logical_ thing be to replace the old code with just a 
> cleaned-up-version of what the old code did, ie just do
> 
> 	err = blk_send_start_stop(q, bd_disk, 0x02);
> 
> for the eject case? That way we could do the patch as a pure cleanup, and 
> then a separate patch might change the singe "start_stop 2" with the more 
> complex sequence.

That would work.

-- 
Jens Axboe


  reply	other threads:[~2005-12-19 20:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-19 15:32 [PATCH 2.6.15-rc6] block: Make CDROMEJECT more robust Ben Collins
2005-12-19 19:35 ` Jens Axboe
2005-12-19 19:35   ` Jens Axboe
2005-12-19 19:44   ` Ben Collins
2005-12-19 19:56     ` Jens Axboe
2005-12-19 20:27       ` Ben Collins
2005-12-19 20:46         ` Jens Axboe
2005-12-19 21:24           ` Ben Collins
2005-12-19 20:02     ` Linus Torvalds
2005-12-19 20:07       ` Jens Axboe [this message]
2005-12-19 20:37       ` Ben Collins
2005-12-19 19:58   ` Ben Collins
2005-12-19 20:05     ` Jens Axboe

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=20051219200734.GQ3734@suse.de \
    --to=axboe@suse.de \
    --cc=akpm@osdl.org \
    --cc=bcollins@ubuntu.com \
    --cc=ben.collins@ubuntu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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