From owner-svn-src-all@FreeBSD.ORG Wed Mar 17 20:27:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39F471065672; Wed, 17 Mar 2010 20:27:36 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E5138FC20; Wed, 17 Mar 2010 20:27:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2HKRZ8a008356; Wed, 17 Mar 2010 20:27:35 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2HKRZhj008354; Wed, 17 Mar 2010 20:27:35 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201003172027.o2HKRZhj008354@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 17 Mar 2010 20:27:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205259 - stable/8/sbin/growfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Mar 2010 20:27:36 -0000 Author: gavin Date: Wed Mar 17 20:27:35 2010 New Revision: 205259 URL: http://svn.freebsd.org/changeset/base/205259 Log: Merge r203835 from head: When growing a UFS1 filesystem, we need to initialise all inodes in any new cylinder groups that are created. When the filesystem is first created, newfs always initialises the first two blocks of inodes, and then in the UFS1 case will also initialise the remaining inode blocks. The changes in growfs.c 1.23 broke the initialisation of all inodes, seemingly based on this implementation detail in newfs(8). The result was that instead of initialising all inodes, we would actually end up initialising all but the first two blocks of inodes. If the filesystem was grown into empty (all-zeros) space then the resulting filesystem was fine, however when grown onto non-zeroed space the filesystem produced would appear to have massive corruption on the first fsck after growing. A test case for this problem can be found in the PR audit trail. Fix this by once again initialising all inodes in the UFS1 case. PR: bin/115174 Submitted by: "Nate Eldredge" Reviewed by: mjacob Modified: stable/8/sbin/growfs/growfs.c Directory Properties: stable/8/sbin/growfs/ (props changed) Modified: stable/8/sbin/growfs/growfs.c ============================================================================== --- stable/8/sbin/growfs/growfs.c Wed Mar 17 20:23:14 2010 (r205258) +++ stable/8/sbin/growfs/growfs.c Wed Mar 17 20:27:35 2010 (r205259) @@ -445,13 +445,11 @@ initcg(int cylno, time_t utime, int fso, acg.cg_cs.cs_nifree--; } /* - * XXX Newfs writes out two blocks of initialized inodes - * unconditionally. Should we check here to make sure that they - * were actually written? + * For the old file system, we have to initialize all the inodes. */ if (sblock.fs_magic == FS_UFS1_MAGIC) { bzero(iobuf, sblock.fs_bsize); - for (i = 2 * sblock.fs_frag; i < sblock.fs_ipg / INOPF(&sblock); + for (i = 0; i < sblock.fs_ipg / INOPF(&sblock); i += sblock.fs_frag) { dp1 = (struct ufs1_dinode *)iobuf; #ifdef FSIRAND