summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>2002-10-18 23:17:30 +0000
committermckusick <mckusick@FreeBSD.org>2002-10-18 23:17:30 +0000
commitf5032b44ed645487cb692a766e2d91c042b55c9e (patch)
tree873fc992177887f92dba2e0d1f71c588945c7bfb /sbin
parentd155b8f135db19093c4bb4a6668074b484da2bb1 (diff)
downloadFreeBSD-src-f5032b44ed645487cb692a766e2d91c042b55c9e.zip
FreeBSD-src-f5032b44ed645487cb692a766e2d91c042b55c9e.tar.gz
Bound the size of the superblock to SBLOCKSIZE.
Submitted by: BOUWSMA Beery <freebsd-misuser@netscum.dyndns.dk> Sponsored by: DARPA & NAI Labs.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/newfs/mkfs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c
index 90561ef..ff37368 100644
--- a/sbin/newfs/mkfs.c
+++ b/sbin/newfs/mkfs.c
@@ -382,6 +382,8 @@ mkfs(struct partition *pp, char *fsys)
if (fscs == NULL)
errx(31, "calloc failed");
sblock.fs_sbsize = fragroundup(&sblock, sizeof(struct fs));
+ if (sblock.fs_sbsize > SBLOCKSIZE)
+ sblock.fs_sbsize = SBLOCKSIZE;
sblock.fs_minfree = minfree;
sblock.fs_maxbpg = maxbpg;
sblock.fs_optim = opt;
OpenPOWER on IntegriCloud