diff options
author | trasz <trasz@FreeBSD.org> | 2012-12-15 08:53:58 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2012-12-15 08:53:58 +0000 |
commit | e2e5e9346150e2c5387945fa0637bbd1b60ab046 (patch) | |
tree | 5805dc837e9f74489a8bce54cea0604c2f56ee37 /sbin/growfs | |
parent | 28185626518e530030999ed40cd3ea13edef36ec (diff) | |
download | FreeBSD-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/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 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, |