[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201012082114.41509.eike-kernel@sf-tec.de>
Date: Wed, 8 Dec 2010 21:14:40 +0100
From: Rolf Eike Beer <eike-kernel@...tec.de>
To: Tejun Heo <tj@...nel.org>
Cc: jeff@...zik.org, linux-ide@...r.kernel.org, axboe@...nel.dk,
linux-kernel@...r.kernel.org, linux-scsi@...r.kernel.org,
kay.sievers@...y.org, jack@...e.cz,
James.Bottomley@...senpartnership.com
Subject: Re: [PATCH 5/8] scsi: fix TUR error handling in sr_media_change()
Tejun Heo wrote:
> --- a/drivers/scsi/sr.c
> +++ b/drivers/scsi/sr.c
> @@ -214,13 +214,17 @@ static int sr_media_change(struct cdrom_device_info
> *cdi, int slot)
>
> sshdr = kzalloc(sizeof(*sshdr), GFP_KERNEL);
> retval = sr_test_unit_ready(cd->device, sshdr);
> - if (retval || (scsi_sense_valid(sshdr) &&
> - /* 0x3a is medium not present */
> - sshdr->asc == 0x3a)) {
> - /* Media not present or unable to test, unit probably not
> - * ready. This usually means there is no disc in the drive.
> - * Mark as changed, and we will figure it out later once
> - * the drive is available again.
> + /*
> + * Media is considered to be present if TUR succeeds or fails with
> + * sense data indicating something other than media-not-present
> + * (ASC 0x3a).
> + */
> + if (!scsi_status_is_good(retval) &&
> + (!scsi_sense_valid(sshdr) || sshdr->asc == 0x3a)) {
> + /*
> + * Probably not media in the device. Mark as changed, and
> + * we will figure it out later once the drive is available
> + * again.
"Probably no media ..."?
Eike
Download attachment "signature.asc " of type "application/pgp-signature" (199 bytes)
Powered by blists - more mailing lists