Author: trasz
Date: Sun May  6 11:48:37 2012
New Revision: 235079
URL: http://svn.freebsd.org/changeset/base/235079

Log:
  Fix offset calculation to actually rewrite the _last_ block.

Modified:
  head/sbin/growfs/growfs.c

Modified: head/sbin/growfs/growfs.c
==============================================================================
--- head/sbin/growfs/growfs.c   Sun May  6 11:41:00 2012        (r235078)
+++ head/sbin/growfs/growfs.c   Sun May  6 11:48:37 2012        (r235079)
@@ -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);
 
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to