From: Matthew Dharm <mdharm-scsi@one-eyed-alien.net>
To: James Bottomley <James.Bottomley@SteelEye.com>
Cc: Linus Torvalds <torvalds@transmeta.com>,
USB Developers <linux-usb-devel@lists.sourceforge.net>,
USB Storage List <usb-storage@one-eyed-alien.net>,
Linux SCSI list <linux-scsi@vger.kernel.org>,
Greg KH <greg@kroah.com>
Subject: Re: PATCH: exclude certain commands from emulated SCSI hosts
Date: Mon, 21 Apr 2003 10:02:02 -0700 [thread overview]
Message-ID: <20030421100202.B12581@one-eyed-alien.net> (raw)
In-Reply-To: <1050942042.2269.3.camel@mulgrave>; from James.Bottomley@SteelEye.com on Mon, Apr 21, 2003 at 11:20:40AM -0500
[-- Attachment #1: Type: text/plain, Size: 2616 bytes --]
I happen to think that most of this needs a rewrite into a well-structured
loop. I'm not a big fan of goto. But hey, it works and will probably get
us where we need to go without changing the behavior enough to disturb
other SCSI elements.
Matt
On Mon, Apr 21, 2003 at 11:20:40AM -0500, James Bottomley wrote:
> On Sun, 2003-04-20 at 16:35, Matthew Dharm wrote:
> > On Sun, Apr 20, 2003 at 02:33:51PM -0700, Matthew Dharm wrote:
> > > I've tested this, and it works well. Linus, if you'll take this I've got
> > > several more patches -- ones to make usb-storage use this to cut some
> > > undesireable commands, and one to fix up the INQUIRY probing in scsi_scan.c
> > > to be compatible with the filter code.
> >
> > Here is my patch to the SCSI scanning code. Basically, if the first
> > INQUIRY for 36 bytes works, but a later one fails because of the filter, we
> > should still accept the device.
> >
> > Linus, please apply. I'll push the usb-storage patches via Greg K-H once
> > these are accepted.
>
> Actually, I'm not very keen about the levels of nested inquiry in this.
> How about the attached instead?
>
> James
>
> ===== drivers/scsi/scsi_scan.c 1.77 vs edited =====
> --- 1.77/drivers/scsi/scsi_scan.c Sun Apr 20 18:21:18 2003
> +++ edited/drivers/scsi/scsi_scan.c Mon Apr 21 11:17:20 2003
> @@ -1001,6 +1001,7 @@
> unsigned char scsi_cmd[MAX_COMMAND_SIZE];
> int possible_inq_resp_len;
>
> + repeat_inquiry:
> SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO "scsi scan: INQUIRY to host %d"
> " channel %d id %d lun %d\n", sdev->host->host_no,
> sdev->channel, sdev->id, sdev->lun));
> @@ -1067,8 +1068,14 @@
> SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO "scsi scan: 2nd INQUIRY"
> " %s with code 0x%x\n", sreq->sr_result ?
> "failed" : "successful", sreq->sr_result));
> - if (sreq->sr_result)
> - return;
> + if (sreq->sr_result) {
> + /* if the longer inquiry has failed, flag the device
> + * as only accepting 36 byte inquiries and retry the
> + * 36 byte inquiry */
> + printk(KERN_INFO "scsi scan: %d byte inquiry failed with code %d. Consider BLIST_INQUIRY_36 for this device\n", sreq->sr_result);
> + *bflags |= BLIST_INQUIRY_36;
> + goto repeat_inquiry;
> + }
>
> /*
> * The INQUIRY can change, this means the length can change.
--
Matthew Dharm Home: mdharm-usb@one-eyed-alien.net
Maintainer, Linux USB Mass Storage Driver
What, are you one of those Microsoft-bashing Linux freaks?
-- Customer to Greg
User Friendly, 2/10/1999
[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]
next prev parent reply other threads:[~2003-04-21 16:50 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20030322193046.A17056@one-eyed-alien.net>
[not found] ` <20030322193149.B17056@one-eyed-alien.net>
2003-03-23 3:37 ` PATCH: exclude certain commands from emulated SCSI hosts Matthew Dharm
2003-03-23 4:09 ` Linus Torvalds
2003-03-23 7:31 ` Matthew Dharm
2003-03-23 7:39 ` Linus Torvalds
2003-03-23 18:13 ` [usb-storage] " Matthew Dharm
2003-03-24 1:05 ` Douglas Gilbert
2003-03-24 1:26 ` James Bottomley
2003-03-24 1:37 ` Matthew Dharm
2003-03-24 1:39 ` James Bottomley
2003-03-24 7:04 ` Matthew Dharm
2003-03-24 15:15 ` James Bottomley
2003-03-24 16:29 ` Linus Torvalds
2003-03-24 16:43 ` James Bottomley
2003-03-24 16:52 ` Jens Axboe
2003-03-24 16:56 ` James Bottomley
2003-03-24 17:30 ` Matthew Dharm
2003-04-05 15:30 ` James Bottomley
2003-04-05 19:27 ` Matthew Dharm
2003-04-05 19:45 ` James Bottomley
2003-04-05 19:55 ` Matthew Dharm
2003-04-05 20:08 ` James Bottomley
2003-04-06 0:20 ` Matthew Dharm
2003-04-06 0:22 ` Matthew Dharm
2003-04-06 15:39 ` James Bottomley
2003-04-07 22:33 ` Patrick Mansfield
2003-04-07 23:14 ` James Bottomley
2003-04-08 0:51 ` Patrick Mansfield
2003-04-20 21:33 ` Matthew Dharm
2003-04-20 21:35 ` Matthew Dharm
2003-04-21 16:20 ` James Bottomley
2003-04-21 17:02 ` Matthew Dharm [this message]
2003-04-21 16:28 ` James Bottomley
2003-04-21 17:01 ` Matthew Dharm
2003-04-21 19:23 ` James Bottomley
2003-04-21 19:35 ` Matthew Dharm
2003-04-21 21:27 ` James Bottomley
2003-04-21 23:37 ` Matthew Dharm
2003-04-21 21:28 ` Patrick Mansfield
2003-04-21 23:45 ` Matthew Dharm
2003-03-24 1:58 ` Linus Torvalds
2003-03-24 6:58 ` Matthew Dharm
2003-04-22 17:37 [usb-storage] " James Bottomley
2003-04-22 18:13 ` Alan Stern
-- strict thread matches above, loose matches on Subject: below --
2003-04-22 19:30 Andries.Brouwer
2003-04-22 19:41 ` James Bottomley
2003-04-22 19:50 Andries.Brouwer
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=20030421100202.B12581@one-eyed-alien.net \
--to=mdharm-scsi@one-eyed-alien.net \
--cc=James.Bottomley@SteelEye.com \
--cc=greg@kroah.com \
--cc=linux-scsi@vger.kernel.org \
--cc=linux-usb-devel@lists.sourceforge.net \
--cc=torvalds@transmeta.com \
--cc=usb-storage@one-eyed-alien.net \
/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