diff options
author | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2012-12-15 08:53:58 +0000 |
---|---|---|
committer | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2012-12-15 08:53:58 +0000 |
commit | cd379aaff17d5a9590a273ae8927aac479e556fb (patch) | |
tree | 5805dc837e9f74489a8bce54cea0604c2f56ee37 /sbin/growfs | |
parent | 14df601e475824e501f40eca79f8c0f5872807ba (diff) | |
download | src-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.c | 6 |
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, |