From cd379aaff17d5a9590a273ae8927aac479e556fb Mon Sep 17 00:00:00 2001 From: Edward Tomasz Napierala Date: Sat, 15 Dec 2012 08:53:58 +0000 Subject: [PATCH] Fix extending filesystems of weird size by making sure the actual size is always multiple of fragment size. --- sbin/growfs/growfs.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sbin/growfs/growfs.c b/sbin/growfs/growfs.c index 042aada6d07..c93d111a977 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,