diff options
author | Colin Percival <cperciva@FreeBSD.org> | 2011-04-26 02:06:31 +0000 |
---|---|---|
committer | Colin Percival <cperciva@FreeBSD.org> | 2011-04-26 02:06:31 +0000 |
commit | c2805605f73ceac688828f7a52c77c4c1b6d8345 (patch) | |
tree | 719c084adac61ea799d8159dbf93d28c27290cd4 /sbin/newfs/mkfs.c | |
parent | 6bb544780b1d08d0bcac6703f199c145aa01f527 (diff) | |
download | src-c2805605f73ceac688828f7a52c77c4c1b6d8345.tar.gz src-c2805605f73ceac688828f7a52c77c4c1b6d8345.zip |
Notes
Diffstat (limited to 'sbin/newfs/mkfs.c')
-rw-r--r-- | sbin/newfs/mkfs.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c index f98a51a7c313..0503ebf0923d 100644 --- a/sbin/newfs/mkfs.c +++ b/sbin/newfs/mkfs.c @@ -516,9 +516,12 @@ restart: fsdummy.fs_magic = 0; bwrite(&disk, part_ofs + SBLOCK_UFS1 / disk.d_bsize, chdummy, SBLOCKSIZE); - for (cg = 0; cg < fsdummy.fs_ncg; cg++) + for (cg = 0; cg < fsdummy.fs_ncg; cg++) { + if (fsbtodb(&fsdummy, cgsblock(&fsdummy, cg)) > fssize) + break; bwrite(&disk, part_ofs + fsbtodb(&fsdummy, cgsblock(&fsdummy, cg)), chdummy, SBLOCKSIZE); + } } } if (!Nflag) |