From owner-freebsd-current@FreeBSD.ORG Fri Jun 6 18:14:10 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B382837B401 for ; Fri, 6 Jun 2003 18:14:10 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8646543F3F for ; Fri, 6 Jun 2003 18:14:09 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id LAA13099; Sat, 7 Jun 2003 11:13:59 +1000 Date: Sat, 7 Jun 2003 11:13:58 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Per Kristian Hove In-Reply-To: Message-ID: <20030607105610.R36915@gamplex.bde.org> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-current@freebsd.org Subject: Re: geom_vol_ffs problems X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jun 2003 01:14:11 -0000 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