summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2012-12-15 08:53:58 +0000
committertrasz <trasz@FreeBSD.org>2012-12-15 08:53:58 +0000
commite2e5e9346150e2c5387945fa0637bbd1b60ab046 (patch)
tree5805dc837e9f74489a8bce54cea0604c2f56ee37 /sbin
parent28185626518e530030999ed40cd3ea13edef36ec (diff)
downloadFreeBSD-src-e2e5e9346150e2c5387945fa0637bbd1b60ab046.zip
FreeBSD-src-e2e5e9346150e2c5387945fa0637bbd1b60ab046.tar.gz
Fix extending filesystems of weird size by making sure the actual size
is always multiple of fragment size.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/growfs/growfs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sbin/growfs/growfs.c b/sbin/growfs/growfs.c
index 042aada..c93d111 100644
--- a/sbin/growfs/growfs.c
+++ b/sbin/growfs/growfs.c
@@ -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,
OpenPOWER on IntegriCloud