Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Dec 2012 08:53:58 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r244243 - head/sbin/growfs
Message-ID:  <201212150853.qBF8rwQa011023@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Sat Dec 15 08:53:58 2012
New Revision: 244243
URL: http://svnweb.freebsd.org/changeset/base/244243

Log:
  Fix extending filesystems of weird size by making sure the actual size
  is always multiple of fragment size.

Modified:
  head/sbin/growfs/growfs.c

Modified: head/sbin/growfs/growfs.c
==============================================================================
--- head/sbin/growfs/growfs.c	Sat Dec 15 08:29:22 2012	(r244242)
+++ head/sbin/growfs/growfs.c	Sat Dec 15 08:53:58 2012	(r244243)
@@ -1487,6 +1487,12 @@ main(int argc, char **argv)
 		}
 	}
 
+	/*
+	 * Make sure the new size is a multiple of fs_fsize; /dev/ufssuspend
+	 * only supports fragment-aligned IO requests.
+	 */
+	size -= size % osblock.fs_fsize;
+
 	if (size <= (uint64_t)(osblock.fs_size * osblock.fs_fsize)) {
 		humanize_number(oldsizebuf, sizeof(oldsizebuf),
 		    osblock.fs_size * osblock.fs_fsize,



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