geom_vol_ffs problems
Bruce Evans
bde at zeta.org.au
Fri Jun 6 18:14:11 PDT 2003
On Fri, 6 Jun 2003, Per Kristian Hove wrote:
> I've nailed it down to this: geom_vol_ffs assumes that a file system
> is able to fill the partition completely. That's not a valid
> assumption, since the file system size is a multiple of the file
> system block size (in my case 16k bytes = 32 blocks), and the
> partition size is/should be a multiple of the sectors/cylinder count
> (in my case 1008).
>
> For this assumption to be valid, the sectors/cylinder count would have
> to be a multiple of the file system block size (measured in blocks),
> and there's no guarantee that that's the case.
>
> In my case, the size of the filesystem on ad0s3f (the one that does
> not appear in /dev/vol/) is one block less than the size of ad0s3f
> itself, so geom_vol_ffs refuses to create a provider for it (lines 96
> and 102 in geom_vol_ffs.c):
>
> if (fs->fs_old_size * fs->fs_fsize !=
> (int32_t) pp->mediasize) {
> g_free(fs);
> continue;
> }
Other bugs in this code include overflow for file systems larger than a
whole 2GB, a bogus cast to give the correct result if the overflow is
benign and the actual sizes don't differ by a multiple of 4G, and a
style bug in the bogus cast (casts and sizeofs are not followed by a
space).
Bruce
More information about the freebsd-current
mailing list