Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Jun 2003 11:13:58 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Per Kristian Hove <Per.Hove@math.ntnu.no>
Cc:        freebsd-current@freebsd.org
Subject:   Re: geom_vol_ffs problems
Message-ID:  <20030607105610.R36915@gamplex.bde.org>
In-Reply-To: <Pine.GSO.4.52.0306061813000.17732@abel.math.ntnu.no>
References:  <Pine.GSO.4.52.0306041435020.6491@abel.math.ntnu.no> <Pine.GSO.4.52.0306061813000.17732@abel.math.ntnu.no>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030607105610.R36915>