From owner-svn-src-stable-8@FreeBSD.ORG Tue May 3 16:36:39 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FB961065672; Tue, 3 May 2011 16:36:39 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5CCF18FC16; Tue, 3 May 2011 16:36:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p43Gadxc002220; Tue, 3 May 2011 16:36:39 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p43GadGd002218; Tue, 3 May 2011 16:36:39 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201105031636.p43GadGd002218@svn.freebsd.org> From: Colin Percival Date: Tue, 3 May 2011 16:36:39 +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: r221392 - stable/8/sbin/newfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 May 2011 16:36:39 -0000 Author: cperciva Date: Tue May 3 16:36:39 2011 New Revision: 221392 URL: http://svn.freebsd.org/changeset/base/221392 Log: MFC r221049: Stop zeroing UFS1 superblocks if we fall off the end of the disk, in order to avoid wasting time (potentially many hours) in the event that we find a partially-overwritten UFS1 superblock. Modified: stable/8/sbin/newfs/mkfs.c Directory Properties: stable/8/sbin/newfs/ (props changed) Modified: stable/8/sbin/newfs/mkfs.c ============================================================================== --- stable/8/sbin/newfs/mkfs.c Tue May 3 16:00:36 2011 (r221391) +++ stable/8/sbin/newfs/mkfs.c Tue May 3 16:36:39 2011 (r221392) @@ -517,9 +517,12 @@ restart: fsdummy.fs_magic = 0; bwrite(&disk, part_ofs + SBLOCK_UFS1 / disk.d_bsize, chdummy, SBLOCKSIZE); - for (cg = 0; cg < fsdummy.fs_ncg; cg++) + for (cg = 0; cg < fsdummy.fs_ncg; cg++) { + if (fsbtodb(&fsdummy, cgsblock(&fsdummy, cg)) > fssize) + break; bwrite(&disk, part_ofs + fsbtodb(&fsdummy, cgsblock(&fsdummy, cg)), chdummy, SBLOCKSIZE); + } } } if (!Nflag)