From 9a3b66f310897ac5d572ba3892d80b0b141f522f Mon Sep 17 00:00:00 2001 From: trasz Date: Sun, 6 May 2012 11:48:37 +0000 Subject: Fix offset calculation to actually rewrite the _last_ block. --- sbin/growfs/growfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sbin') diff --git a/sbin/growfs/growfs.c b/sbin/growfs/growfs.c index aee4c40..b610bd2 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); -- cgit v1.1