Subject: Re: kern/3460: block io unit for sd should be sector size
To: None <salvet@ics.muni.cz, salvet@horn.ics.muni.cz>
From: Koji Imada - je4wob/2 <koji@math.human.nagoya-u.ac.jp>
List: netbsd-bugs
Date: 04/16/1997 00:48:57
>>>>> "Zdenek" == Zdenek Salvet <salvet@horn.ics.muni.cz> writes:

 Zdenek> What is the relation between fs sector size (newfs -S) and disklabel sector
 Zdenek> size? What about vnd (no disklabel) ?

In case of ffs, fs sector size can be calculated from superblock
information. So it is possible to make fs sector size greater than
disklabel sector size. But current ffs implementation assumes "fs
sector size == disklabel sector size". In my second method, It is
possible to make "fs sector size != disklabel sector size". This is
useful for current vnd because current vnd can't handle disklabel and
disklabel sector size of vnd is constant(DEV_BSIZE).

 Zdenek> Will it be possible to have CD image on disk with second method ? 

In the other hand, current cd9660 implementation assumes that block io
unit is DEV_BSIZE(same with "second method"). It is easy to use
"second method" for cd9660.

Current condition is:

	file system:
	ffs	fs sector size == block io unit.
	msdosfs	fs sector size == block io unit.
	cd9660	fs sector size == 2048 and
		block io unit == DEV_BSIZE.

	device driver:
	sd	block io unit == DEV_BSIZE and
		disklabel sector size == physical sector size.
	cd	block io unit == DEV_BSIZE and
		disklabel sector size == physical sector size.
	vnd	block io unit == DEV_BSIZE.

	disklabel routines(which checks partition boundary):
	block number unit == disklabel sector size == DEV_BSIZE

So, fs sector size of ffs/msdosfs must be DEV_BSIZE in current
implementation. But having CD image on disk(also vnd) may be possible
in current implementation(using raw partition or disklabel trick maybe 
necessary).

Anyway, fs sector size, block io unit, disklabel sector size and
physical sector size are confusing.

To clear these conditions, notion of block io unit and disklabel
sector size should be standardized.

1. "block io unit == disklabel sector size" case.
	ffs/msdosfs with fs sector size greater than DEV_BSIZE(512) is 
	possible if disklabel sector size is appropriate with no
	modification.

	cd9660 needs modification to get block io unit(== disklabel
	sector size) and to convert block io unit.

	cd and sd device driver needs modification to support "block
	io unit == disklabel sector size" and
	"disklabel sector size != physical sector size".
	vnd needs support for disklabel.

	disklabel routines needs modification to support
	"block number unit == disklabel sector size != DEV_BSIZE".

2. "block io unit == DEV_BSIZE" case.
	ffs/msdosfs needs modification to convert block io unit to
	DEV_BSIZE.

	cd9660 don't needs modification.

	sd and cd device driver needs modification to support
	"disklabel sector size != physical sector size".

	It is not necessary to support disklabel on vnd.

	disklabel routines needs modification to support
	"block number unit == DEV_BSIZE != disklabel sector size".

1 and 2 correspond to my "first" and "second" method.

The advantages of "second method" is:

	It is not necessary to get disklabel sector size. 

	So It is possible to have file system which fs sector size is
	not physical sector size without disklabel.

	And to have different file system which has each fs sector
	size on same disk(ex. ffs with 512 fs sector size and
	cd9660).

On the other hand, the advantage of "first method" is:

	Simple implementation.
--
Koji Imada
koji@math.human.nagoya-u.ac.jp