diff options
author | Yaroslav Tykhiy <ytykhiy@gmail.com> | 2003-08-05 13:35:17 +0000 |
---|---|---|
committer | Yaroslav Tykhiy <ytykhiy@gmail.com> | 2003-08-05 13:35:17 +0000 |
commit | 244fca1ffa4b574714385c9d7ffb43e04df7ee0a (patch) | |
tree | 5800ebafff4e8b0dde7277b7386923e6293c93e5 /sbin/newfs/mkfs.c | |
parent | 449f11fac6fbc28673616f03b6fa63500e2313f5 (diff) | |
download | src-244fca1ffa4b574714385c9d7ffb43e04df7ee0a.tar.gz src-244fca1ffa4b574714385c9d7ffb43e04df7ee0a.zip |
Exit with a non-zero status upon a block allocation failure.
The old way of just returning could result in a file system
extremely likely to panic the kernel. The warning printed
wouldn't help much since tools invoking newfs(8), e.g., mdmfs(8),
couldn't detect the error.
PR: bin/55078
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=118493
Diffstat (limited to 'sbin/newfs/mkfs.c')
-rw-r--r-- | sbin/newfs/mkfs.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c index ea576efd2676..80ed645569ea 100644 --- a/sbin/newfs/mkfs.c +++ b/sbin/newfs/mkfs.c @@ -789,17 +789,17 @@ alloc(int size, int mode) sblock.fs_cgsize); if (acg.cg_magic != CG_MAGIC) { printf("cg 0: bad magic number\n"); - return (0); + exit(38); } if (acg.cg_cs.cs_nbfree == 0) { printf("first cylinder group ran out of space\n"); - return (0); + exit(39); } for (d = 0; d < acg.cg_ndblk; d += sblock.fs_frag) if (isblock(&sblock, cg_blksfree(&acg), d / sblock.fs_frag)) goto goth; printf("internal error: can't find block in cyl 0\n"); - return (0); + exit(40); goth: blkno = fragstoblks(&sblock, d); clrblock(&sblock, cg_blksfree(&acg), blkno); |