diff options
author | dyson <dyson@FreeBSD.org> | 1995-05-01 23:20:24 +0000 |
---|---|---|
committer | dyson <dyson@FreeBSD.org> | 1995-05-01 23:20:24 +0000 |
commit | 7972592fe7cbd5b0d040584b21ba04d2d354c604 (patch) | |
tree | 2e6db3cdacc770ed0124a3b81a764aaf3611a615 /sys | |
parent | 5a37c09cb9147f67220b01c431419f4bc807876f (diff) | |
download | FreeBSD-src-7972592fe7cbd5b0d040584b21ba04d2d354c604.zip FreeBSD-src-7972592fe7cbd5b0d040584b21ba04d2d354c604.tar.gz |
Limit filesize to the amount that the VM system can currently handle
(2GB). If this limit is not imposed, then filesystem corruption will
ensue when files larger than 2GB are created. This is temporary,
and the underlying limitation will be removed later.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index b1a20d6..d13af91 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ffs_vfsops.c 8.8 (Berkeley) 4/18/94 - * $Id: ffs_vfsops.c,v 1.16 1995/04/09 06:03:37 davidg Exp $ + * $Id: ffs_vfsops.c,v 1.17 1995/04/11 04:23:47 davidg Exp $ */ #include <sys/param.h> @@ -67,6 +67,7 @@ int ffs_sbupdate __P((struct ufsmount *, int)); int ffs_reload __P((struct mount *,struct ucred *,struct proc *)); int ffs_oldfscompat __P((struct fs *)); +void ffs_vmlimits __P((struct fs *)); struct vfsops ufs_vfsops = { ffs_mount, @@ -296,6 +297,7 @@ ffs_reload(mountp, cred, p) bp->b_flags |= B_INVAL; brelse(bp); ffs_oldfscompat(fs); + ffs_vmlimits(fs); /* * Step 3: re-read summary information from disk. */ @@ -458,6 +460,7 @@ ffs_mountfs(devvp, mp, p) ump->um_quotas[i] = NULLVP; devvp->v_specflags |= SI_MOUNTEDON; ffs_oldfscompat(fs); + ffs_vmlimits(fs); if (ronly == 0) ffs_sbupdate(ump, MNT_WAIT); return (0); @@ -506,6 +509,18 @@ ffs_oldfscompat(fs) } /* + * Sanity check for VM file size limits -- temporary until + * VM system can support > 32bit offsets + */ +void +ffs_vmlimits(fs) + struct fs *fs; +{ + if( fs->fs_maxfilesize > (((u_quad_t) 1 << 31) - 1)) + fs->fs_maxfilesize = ((u_quad_t) 1 << 31) - 1; +} + +/* * unmount system call */ int |