Subject: Re: sd(4) block size detection (Re: SCSI Mode Sense on page 0)
To: ITOH Yasufumi <itohy@netbsd.org>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-kern
Date: 11/24/2006 19:58:06
On Sat, Nov 25, 2006 at 02:58:07AM +0900, ITOH Yasufumi wrote:
> I noticed the page contents of Mode Sense is not used, but
> the block descriptor (sent prior to the page contents) is used,
> so it is not that vendor-specific (but this device don't like it).
> On the contrary the Read Format Capacities command seems vendor-specific.
> 
> Hmm, then, I'd like to change current method of detecting block size
> 
> 	if Read Capacity failed
> 		use Read Format Capacities
> 		if invalid use 512
> 	else
> 		use Mode Sense page 0
> 		if failed, use value of Read Capacity or 512 if invalid
> 
> to a new method:
> 
> 	if Read Capacity failed
> 		use Read Format Capacities
> 	else if value of Read Capacity is invalid
> 		use Mode Sense 0
> 	if above block size is invalid
> 		use 512
> 
> We don't support multiple block sizes per LUN, and if Read Capacity
> reports valid block size, why don't we use it?
> 
> Is this change OK?

Yes, this looks good to me.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--