aboutsummaryrefslogtreecommitdiff
path: root/sbin/growfs
diff options
context:
space:
mode:
authorEdward Tomasz Napierala <trasz@FreeBSD.org>2012-12-15 08:53:58 +0000
committerEdward Tomasz Napierala <trasz@FreeBSD.org>2012-12-15 08:53:58 +0000
commitcd379aaff17d5a9590a273ae8927aac479e556fb (patch)
tree5805dc837e9f74489a8bce54cea0604c2f56ee37 /sbin/growfs
parent14df601e475824e501f40eca79f8c0f5872807ba (diff)
downloadsrc-cd379aaff17d5a9590a273ae8927aac479e556fb.tar.gz
src-cd379aaff17d5a9590a273ae8927aac479e556fb.zip
Fix extending filesystems of weird size by making sure the actual size
is always multiple of fragment size.
Notes
Notes: svn path=/head/; revision=244243
Diffstat (limited to 'sbin/growfs')
-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 042aada6d070..c93d111a9776 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,