From deb35287b362d4568b165c0a7599bc277ef71508 Mon Sep 17 00:00:00 2001 From: Edward Tomasz Napierala Date: Sun, 6 May 2012 11:48:37 +0000 Subject: [PATCH] Fix offset calculation to actually rewrite the _last_ block. --- sbin/growfs/growfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/growfs/growfs.c b/sbin/growfs/growfs.c index aee4c40446cd..b610bd2f8c8f 100644 --- a/sbin/growfs/growfs.c +++ b/sbin/growfs/growfs.c @@ -1567,9 +1567,9 @@ main(int argc, char **argv) testbuf = malloc(sblock.fs_fsize); if (testbuf == NULL) err(1, "malloc"); - rdfs((ufs2_daddr_t)((size / DEV_BSIZE) - sblock.fs_fsize), + rdfs((ufs2_daddr_t)((size - sblock.fs_fsize) / DEV_BSIZE), sblock.fs_fsize, testbuf, fsi); - wtfs((ufs2_daddr_t)((size / DEV_BSIZE) - sblock.fs_fsize), + wtfs((ufs2_daddr_t)((size - sblock.fs_fsize) / DEV_BSIZE), sblock.fs_fsize, testbuf, fso, Nflag); free(testbuf);