public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Boaz Harrosh <bharrosh@panasas.com>
To: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: linux1394-devel@lists.sourceforge.net, linux-scsi@vger.kernel.org
Subject: Re: On patch "Let scsi_cmnd->cmnd use request->cmd buffer"
Date: Sun, 04 May 2008 16:36:39 +0300	[thread overview]
Message-ID: <481DBBE7.3060602@panasas.com> (raw)
In-Reply-To: <tkrat.4814bd8a1738df8c@s5r6.in-berlin.de>

Stefan Richter wrote:
> On  4 May, Stefan Richter wrote:
>> Boaz Harrosh wrote:
>>> cmd->cmd_len is now guarantied to be set properly at all cases.
>>> And some commands you want to support will not be set correctly
>>> by COMMAND_SIZE().
> ...
>> --- linux.orig/drivers/ieee1394/sbp2.c
>> +++ linux/drivers/ieee1394/sbp2.c
> ...
>>  	memset(orb->cdb, 0, 12);

if you are at it?
- 	memset(orb->cdb, 0, 12);
+ 	memset(orb->cdb, 0, sizeof(orb->cdb));

>> -	memcpy(orb->cdb, scsi_cmd, COMMAND_SIZE(*scsi_cmd));
>> +	memcpy(orb->cdb, SCpnt->cmnd, SCpnt->cmd_len);
> ...
> 
> Wait a minute...
> 
> drivers/ieee1394/sbp2.[ch] and drivers/firewire/fw-sbp2.c hardwire the
> maximum size of the command descriptor block (command_block field in the
> command block ORB as per SBP-2 clause 5.1.2) to 12 bytes.
> 
> We need to use BLK_MAX_CDB there, don't we?
> 
> (Besides, we should keep an eye on unit_characteristics.ORB_size as per
> SBP-2 clause 7.4.8, but that's another story.)

I'm not sure what you mean. But orb->cdb is 12 bytes, and setting max_cmd_len in
host template insures midlayer will never send a command bigger then that. So
->cmd_len will never be bigger then host->max_cmd_len. BLK_MAX_CDB should not
be used here.

But I don't see .max_cmd_len set in this file, is it set elsewhere?

Boaz

  reply	other threads:[~2008-05-04 13:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-03 23:30 On patch "Let scsi_cmnd->cmnd use request->cmd buffer" Stefan Richter
2008-05-04 12:15 ` Boaz Harrosh
2008-05-04 12:44   ` Stefan Richter
2008-05-04 13:01     ` Stefan Richter
2008-05-04 13:36       ` Boaz Harrosh [this message]
2008-05-04 13:46         ` Boaz Harrosh
2008-05-04 14:50           ` Stefan Richter
2008-05-04 14:54         ` Stefan Richter

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=481DBBE7.3060602@panasas.com \
    --to=bharrosh@panasas.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    --cc=stefanr@s5r6.in-berlin.de \
    /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