Bound the size of the superblock to SBLOCKSIZE.

Submitted by:	BOUWSMA Beery <freebsd-misuser@netscum.dyndns.dk>
Sponsored by:	DARPA & NAI Labs.
This commit is contained in:
Kirk McKusick 2002-10-18 23:17:30 +00:00
parent 1b7e3dafdf
commit ecfc865a4b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=105423

View File

@ -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;