[Midnightbsd-cvs] src [8701] trunk/sbin/growfs/growfs.c: fix extending filesystems of weird size

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun Sep 25 18:15:49 EDT 2016


Revision: 8701
          http://svnweb.midnightbsd.org/src/?rev=8701
Author:   laffer1
Date:     2016-09-25 18:15:49 -0400 (Sun, 25 Sep 2016)
Log Message:
-----------
fix extending filesystems of weird size

Modified Paths:
--------------
    trunk/sbin/growfs/growfs.c

Modified: trunk/sbin/growfs/growfs.c
===================================================================
--- trunk/sbin/growfs/growfs.c	2016-09-25 22:15:10 UTC (rev 8700)
+++ trunk/sbin/growfs/growfs.c	2016-09-25 22:15:49 UTC (rev 8701)
@@ -1486,6 +1486,12 @@
 		}
 	}
 
+	/*
+	 * 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,



More information about the Midnightbsd-cvs mailing list