Re: [PATCH 8 of 8] libata: Report disk alignment and physical block size

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

 



>>>>> "Matthew" == Matthew Wilcox <matthew@xxxxxx> writes:

Matthew> I found it clearer to do:
Matthew> 			u16 first = word_209 & 0x3fff; if
Matthew> 			(first)
Matthew> 				lowest_aligned = (1 <<
Matthew> 				log_per_phys) - first;

Matthew> but you may disagree.

I don't care much either way.


>> + rbuf[14] = (lowest_aligned_lba >> 8) & 0x3f;

Matthew> Hm, yes, it could overflow ... 1 << 0xf -1 is 32767 (0x7fff)
Matthew> which would be larger than could fit in SCSI's RC16 and ends up
Matthew> inadvertently setting Thin Provisioning Read Zeroes, which we
Matthew> really don't want.  I suppose reporting 0x3fff is better than
Matthew> reporting anything else in this field.  All highly theoretical,
Matthew> since you'd have to have 16MB physical sectors with 512 byte
Matthew> logical sectors to get to this situation.

Yeah, I agree it's mostly in the academic interest bucket.  Just trying
to be defensive about what we return, that's all.

-- 
Martin K. Petersen	Oracle Linux Engineering
--
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