From owner-freebsd-fs@FreeBSD.ORG Thu Oct 1 16:55:11 2009 Return-Path: Delivered-To: freebsd-fs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20040106566B for ; Thu, 1 Oct 2009 16:55:11 +0000 (UTC) (envelope-from mj@feral.com) Received: from ns1.feral.com (ns1.feral.com [192.67.166.1]) by mx1.freebsd.org (Postfix) with ESMTP id D65608FC16 for ; Thu, 1 Oct 2009 16:55:10 +0000 (UTC) Received: from [10.8.0.2] (remotevpn [10.8.0.2]) by ns1.feral.com (8.14.3/8.14.3) with ESMTP id n91GOGfV025773 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 1 Oct 2009 09:24:19 -0700 (PDT) (envelope-from mj@feral.com) Message-ID: <4AC4D7AA.1080005@feral.com> Date: Thu, 01 Oct 2009 09:24:10 -0700 From: Matthew Jacob Organization: Feral Software User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090825 SeaMonkey/1.1.18 MIME-Version: 1.0 To: freebsd-fs@FreeBSD.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.2.3 (ns1.feral.com [10.8.0.1]); Thu, 01 Oct 2009 09:24:19 -0700 (PDT) Cc: Subject: review needed for a simple fix to growfs X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: mjacob@FreeBSD.org List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2009 16:55:11 -0000 I have a simple fix to growfs that eliminates some issues Doug was seeing. I probably don't know enough to know some of the implications of the change and wonder if anyone would care to comment on it? The symptoms would be fsck failures on the grown filesystem- my take is that it was because the new cylinder groups were being initialized as having all the inodes allocated. This is puzzling me because, like, how could this ever have worked? It was trivial for me to reproduce- see http://people.freebsd.org/~mjacob/growfs.failure.txt. The second change, btw, is not essential- it just adjusts maxino down if you had to drop the number of cylinder groups down. Index: growfs.c =================================================================== --- growfs.c (revision 197658) +++ growfs.c (working copy) @@ -401,7 +401,6 @@ acg.cg_magic = CG_MAGIC; acg.cg_cgx = cylno; acg.cg_niblk = sblock.fs_ipg; - acg.cg_initediblk = sblock.fs_ipg; acg.cg_ndblk = dmax - cbase; if (sblock.fs_contigsumsize > 0) acg.cg_nclusterblks = acg.cg_ndblk / sblock.fs_frag; @@ -2217,6 +2216,7 @@ printf("Warning: %jd sector(s) cannot be allocated.\n", (intmax_t)fsbtodb(&sblock, sblock.fs_size % sblock.fs_fpg)); sblock.fs_size = sblock.fs_ncg * sblock.fs_fpg; + maxino -= sblock.fs_ipg; } /*