From owner-svn-src-head@FreeBSD.ORG Wed Nov 27 21:55:44 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5AE356D9; Wed, 27 Nov 2013 21:55:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 429872DCA; Wed, 27 Nov 2013 21:55:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rARLtiaT056744; Wed, 27 Nov 2013 21:55:44 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rARLtiib056743; Wed, 27 Nov 2013 21:55:44 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201311272155.rARLtiib056743@svn.freebsd.org> From: Juli Mallett Date: Wed, 27 Nov 2013 21:55:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258695 - head/usr.sbin/makefs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Nov 2013 21:55:44 -0000 Author: jmallett Date: Wed Nov 27 21:55:43 2013 New Revision: 258695 URL: http://svnweb.freebsd.org/changeset/base/258695 Log: Provide a helpful diagnostic when the minimum size rounded to the block size would exceed the maximum size. This can be a difficult problem to diagnose if one is, for instance, using -s with a fixed size in a script and the bsize calculated for a filesystem image changes, necessitating a re-rounding of the image size or a hand-setting of the bsize. Previously one would get a cryptic message about how the size exceeded the maximum size, which normally only happens if the contents of the image are larger than specified. Modified: head/usr.sbin/makefs/ffs.c Modified: head/usr.sbin/makefs/ffs.c ============================================================================== --- head/usr.sbin/makefs/ffs.c Wed Nov 27 21:51:34 2013 (r258694) +++ head/usr.sbin/makefs/ffs.c Wed Nov 27 21:55:43 2013 (r258695) @@ -361,6 +361,13 @@ ffs_validate(const char *dir, fsnode *ro if (ffs_opts->avgfpdir == -1) ffs_opts->avgfpdir = AFPDIR; + if (roundup(fsopts->minsize, ffs_opts->bsize) > fsopts->maxsize) + errx(1, "`%s' minsize of %lld rounded up to ffs bsize of %d " + "exceeds maxsize %lld. Lower bsize, or round the minimum " + "and maximum sizes to bsize.", dir, + (long long)fsopts->minsize, ffs_opts->bsize, + (long long)fsopts->maxsize); + /* calculate size of tree */ ffs_size_dir(root, fsopts); fsopts->inodes += ROOTINO; /* include first two inodes */