Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Nov 2013 21:55:44 +0000 (UTC)
From:      Juli Mallett <jmallett@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r258695 - head/usr.sbin/makefs
Message-ID:  <201311272155.rARLtiib056743@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201311272155.rARLtiib056743>