Incorrect LBA Returned from scsi_get_lba() and blk_rq_pos() (Possible DIF Impact)

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

 



Hello,

I am testing a SCSI/SAS target with a block size of 4K.    I noticed
that scsi_get_lba which calls blk_rq_pos is returning an incorrect LBA.
The returned LBA value is 8x the actual LBA specified in the CDB:

The following "end_request:" message is printed from blk-core.c:

[  812.451579] sd 6:0:0:0: [sdb]  
[  812.451582] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  812.451585] sd 6:0:0:0: [sdb]  
[  812.451587] Sense Key : Aborted Command [current] 
[  812.451591] sd 6:0:0:0: [sdb]  
[  812.451593] Add. Sense: No additional sense information
[  812.451596] sd 6:0:0:0: [sdb] CDB: 
[  812.451597] Write(10): 2a 20 00 00 03 e8 00 00 01 00
[  812.451606] end_request: I/O error, dev sdb, sector 8000

Above CDB has LBA=0x3e8 which is 1000d.  Printed sector size above is
8000d


I, also, noticed that several drivers use the scsi_get_lba inline in
scsi_cmnd.h to set/check ref tag for DIF.  On a 4K device, this is
resulting in an incorrect ref tag.

Tested with kernel 3.7.5.

Regards,
--sami
--
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