Restrict fs_maxfilesize to 2^40; this is part of a bug fix from Kirk

McKusick to work around problems in FFS related to the blkno of a 64bit
offset not fitting into an int.

Submitted by:	Marshall Kirk McKusick
This commit is contained in:
David Greenman 1994-10-22 02:21:53 +00:00
parent 5663e6de1c
commit a3189e21e6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=3767

View File

@ -284,6 +284,8 @@ mkfs(pp, fsys, fi, fo)
sizepb *= NINDIR(&sblock);
sblock.fs_maxfilesize += sizepb;
}
/* XXX - hack to prevent overflow of a 32bit block number */
sblock.fs_maxfilesize = MIN(sblock.fs_maxfilesize, (u_quad_t) 1 << 39);
/*
* Validate specified/determined secpercyl
* and calculate minimum cylinders per group.