Subject: Re: Supporting sector size != DEV_BSIZE
To: Trevin Beattie <trevin@xmission.com>
From: Chuck Silvers <chuq@chuq.com>
List: tech-kern
Date: 10/14/2001 18:14:22
hi,

I took some time this weekend to play with this some more and I made
a bunch of progress.  I found a disk that would let me reformat it
with 1024-byte sectors, and I managed to mount and access an FFS filesystem
on this disk.  I encountered a couple problems while getting there:

 (1) bounds_check_with_label() is assuming that b_blkno in units of
     sectors, but really it's in units of DEV_BSIZE.

 (2) the FFS superblock field "fs_fsbtodb" is used to translate between
     filesystem blocks and the units of b_blkno, and newfs also assumes
     that b_blkno is in units of the device sector size.  recording the
     device sector size in the filesystem layout like this isn't a good
     idea, since it means that if the filesystem image is copied to a
     device with a different sector size, the filesystem can no longer
     be mounted.

after working around both of these, I could mount and access the filesystem.
there was some problem with these workarounds since the next time I rebooted
I discovered that the boot blocks on my boot disk had been clobbered,
but that should be simple to fix.

so we're actually pretty close to having this working.
I'll probably look at this some more next weekend.

-Chuck