Re: [PATCH] scsi: fix scsi_get_lba helper function for pc command

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

 



On Wed, 02 Jun 2010 09:13:51 -0400
"Martin K. Petersen" <martin.petersen@xxxxxxxxxx> wrote:

> >>>>> "Tomo" == FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx> writes:
> 
> >> scsi LLDs can be pass-through for disks, as well as lots of other
> >> type of devices. They should not assume the role of a disk. The use
> >> of blk_rq_pos() at LLDs is probably wrong in the first place. Unless
> >> it is some kind of scsi emulation driver like scsi_debug.
> 
> Tomo> Not only scsi_debug. Have you seen how scsi_get_lba() is used?
> Tomo> LLDs sometime needs to know lba in scsi commands.
> 
> scsi_get_lba() is used by DIX/DIF-aware HBA drivers to get the first LBA
> for use in reference tag verification/preparation.
> 
> This code path is only executed by the drivers if the command protection
> mode is > SCSI_PROT_NORMAL which can only be true for a READ/WRITE
> command.  I don't see any drivers using it for other purposes.

Yeah, however, seems that there are several drivers that get lba and
sector info from cdb.

Some does it for something like statistics, debug printk, etc.

Some does it to build hardware descriptor (e.g. 3w, megaraid, several
drivers in usb/storage/, etc).

So it would be useful to have scsi_get_lba() that always works, I think.
--
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