Re: [PATCH 1/5] SCSI: Add support for 32-byte CDBs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2009-09-04 at 04:36 -0400, Martin K. Petersen wrote:
> DIF Type 2 drives require 32-byte commands.  Add a suitable flag to
> struct scsi_device that will cause scsi_setup_fs_cmnd() to allocate a
> bigger command buffer.

This does look better than the previous version.

However, I'm afraid the lifetime rules don't look to be correct.

The fundamental problem you have is that the request lives longer than
the cmnd.  You populate req->cmnd but never reset it to the original
when you free the 32 byte command.

Fundamentally, since you know you're always going to be using a 32 byte
command, it looks like the consistent place to do the allocation is in
the block layer.  If we go that route, I'd recommend using a variable
for the length so ATA can use it also for transmitting task files. I've
cc'd Jens to see what he thinks of this.

If we just want to hack it up in the SCSI layer, it seems to me you
don't need to muck with req->cmd.  Just populate cmd->cmnd from the pool
and use the signature (req->cmd != cmd->cmnd) to know you did (thus
dispensing with the flag and keeping req->cmd consistent).

James


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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux