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

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

 



Actually the name scsi_get_lba is misleading that the LLDs can use this function to get the lba from a scsi_cmnd, irrespective of whether it is FS request or not. And I did use it for getting lba in my development driver and faced the problem with non-fs requests and raised the flag.

So IMHO it would be better either to fix the function to return proper value or name it to a different and restrict the usage only for DIF purpose.

Thanks
Sathya

-----Original Message-----
From: FUJITA Tomonori [mailto:fujita.tomonori@xxxxxxxxxxxxx] 
Sent: Thursday, June 03, 2010 4:29 PM
To: martin.petersen@xxxxxxxxxx
Cc: fujita.tomonori@xxxxxxxxxxxxx; bharrosh@xxxxxxxxxxx; James.Bottomley@xxxxxxx; jaxboe@xxxxxxxxxxxx; linux-scsi@xxxxxxxxxxxxxxx; Prakash, Sathya
Subject: Re: [PATCH] scsi: fix scsi_get_lba helper function for pc command

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