On Nov. 01, 2007, 20:40 +0200, Matthew Wilcox <[EMAIL PROTECTED]> wrote:
> On Thu, Nov 01, 2007 at 08:05:06PM +0200, Boaz Harrosh wrote:
>> @@ -287,8 +287,13 @@ struct request {
>>      /*
>>       * when request is used as a packet command carrier
>>       */
>> -    unsigned int cmd_len;
>> +    unsigned short cmd_len;
>> +    unsigned short varlen_cdb_len;  /* length of varlen_cdb buffer */
>>      unsigned char cmd[BLK_MAX_CDB];
>> +    unsigned char *varlen_cdb;      /* an optional variable-length cdb.
>> +                                     * points to a user buffer that must be
>> +                                     * valid until end of request
>> +                                     */
>>  
> 
> Try this instead:
> 
>       unsigned int cmd_len;
> -     unsigned char cmd[BLK_MAX_CDB];
> +     unsigned char _cmd[BLK_MAX_CDB];
> +     unsigned char *cmd;
> 
> Then initialise cmd to the address of _cmd.  If you need to override it
> later (ie patch 3), you can.
> 

I agree this is probably the cleanest implementation but when Boaz and I
initially discussed this approach he convinced me that LL block devices assume
that req->cmd_len <= BLK_MAX_CDB and it is unsafe at the moment to expose them
potentially larger commands.

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to