On Thu, Apr 23, 2009 at 02:25:54PM -0400, Martin K. Petersen wrote: > >>>>> "Konrad" == Konrad Rzeszutek <konrad@xxxxxxxxxxxxxxx> writes: > > [Printing physical block size] > > Konrad> With the changes in the read_capacity_16 (where you set the > Konrad> hw_sector_size) this won't be printed (at least on first probe). > > Why not? The read_capacity_16 sets the sdkp->hw_sector_size to sector_size: @@ -1402,6 +1413,7 @@ static int read_capacity_10(struct scsi_ sector_size = (buffer[4] << 24) | (buffer[5] << 16) | (buffer[6] << 8) | buffer[7]; + sdkp->hw_sector_size = sector_size; lba = (buffer[0] << 24) | (buffer[1] << 16) | (buffer[2] << 8) | buffer[3]; That function also returns that value, which sd_read_capacity assigns to the sector_size variable. So when the check for sdkp->hw_sector_size inequality is reached, it is skiped as sdkp->hw_sector_size == sector_size. No? > > [root@10 ~]# modprobe scsi_debug dev_size_mb=1024 num_parts=4 physblk_exp=3 > scsi 6:0:0:0: Direct-Access Linux scsi_debug 0004 PQ: 0 ANSI: 5 > sd 6:0:0:0: Attached scsi generic sg3 type 0 > sd 6:0:0:0: [sdc] 2097152 512-byte logical blocks: (1.07 GB/1.00 GiB) > sd 6:0:0:0: [sdc] 4096-byte physical blocks Is that doing a read_capacity_16 or _10? > > > Konrad> Another question - should the Documentation/*.txt have an entry > Konrad> about what a 'logical block', and 'physical block' is > Konrad> vs. 'hardware sector' ? > > Well, another item on my todo list is to kill the notion of hardware > sector completely. The protocols have been referring to logical blocks > for ages. Do they refer to physical blocks as well? > > It hasn't been a big problem until now because logical block size has > been equal to the hardware sector size. That's no longer a valid > assumption. Right. > > -- > Martin K. Petersen Oracle Linux Engineering -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html