From: Christoph Hellwig <hch@infradead.org>
To: Mark Haverkamp <markh@linux-foundation.org>
Cc: James Bottomley <James.Bottomley@steeleye.com>,
linux-scsi <linux-scsi@vger.kernel.org>,
Mark Salyzyn <mark_salyzyn@adaptec.com>
Subject: Re: [Patch 2/4] aacraid: expanded expose physical device code
Date: Wed, 24 Jan 2007 05:49:02 +0000 [thread overview]
Message-ID: <20070124054902.GA14694@infradead.org> (raw)
In-Reply-To: <1169593190.10440.23.camel@markh3.pdx.osdl.net>
> + if ((scsicmd->cmnd[0] == INQUIRY) && (expose_physicals <= 0)) {
> + u8 b;
> + u8 b1;
> + /* We can't expose disk devices because we can't
> + * tell whether they are the raw container drives
> + * or stand alone drives. If they have the removable
> + * bit set then we should expose them though.
> + */
> + b = (*(u8*)scsicmd->request_buffer)&0x1f;
> + b1 = ((u8*)scsicmd->request_buffer)[1];
> + if (b == TYPE_TAPE || b == TYPE_WORM ||
> + b == TYPE_ROM || b==TYPE_MOD ||
> + b == TYPE_MEDIUM_CHANGER ||
> + (b == TYPE_DISK && (b1 & 0x80))) {
> + scsicmd->result = DID_OK << 16 |
> + COMMAND_COMPLETE << 8;
This can't work at all. request_buffer is always a scatterlist these days.
Besides this implementation bug it's also not the wrong way to do it either.
Please just return -ENXIO in ->slave_configure if sdev->type is not to
your liking instead of failing the INQUIRY command.
next prev parent reply other threads:[~2007-01-24 5:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-23 22:59 [Patch 2/4] aacraid: expanded expose physical device code Mark Haverkamp
2007-01-24 5:49 ` Christoph Hellwig [this message]
2007-01-24 16:31 ` Mark Haverkamp
2007-01-24 16:51 ` James Bottomley
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=20070124054902.GA14694@infradead.org \
--to=hch@infradead.org \
--cc=James.Bottomley@steeleye.com \
--cc=linux-scsi@vger.kernel.org \
--cc=mark_salyzyn@adaptec.com \
--cc=markh@linux-foundation.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