diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/ufs/ffs/ffs_inode.c | 8 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 5 |
2 files changed, 8 insertions, 5 deletions
diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c index defa2e8..8987383 100644 --- a/sys/ufs/ffs/ffs_inode.c +++ b/sys/ufs/ffs/ffs_inode.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ffs_inode.c 8.5 (Berkeley) 12/30/93 - * $Id: ffs_inode.c,v 1.7 1994/09/02 10:24:55 davidg Exp $ + * $Id: ffs_inode.c,v 1.8 1994/10/10 01:04:37 phk Exp $ */ #include <sys/param.h> @@ -163,9 +163,10 @@ ffs_truncate(ap) int aflags, error, allerror; off_t osize; - if (length < 0) - panic("ffs_truncate: invalid length"); oip = VTOI(ovp); + fs = oip->i_fs; + if (length < 0 || length > fs->fs_maxfilesize) + return (EINVAL); tv = time; if (ovp->v_type == VLNK && (oip->i_size < ovp->v_mount->mnt_maxsymlinklen || oip->i_din.di_blocks == 0)) { @@ -188,7 +189,6 @@ ffs_truncate(ap) return (error); #endif vnode_pager_setsize(ovp, (u_long)length); - fs = oip->i_fs; osize = oip->i_size; /* * Lengthen the size of the file. We must ensure that the diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 73c8c0b..ad3231f 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.8 1994/10/08 06:20:06 phk Exp $ + * $Id: ffs_vfsops.c,v 1.9 1994/10/10 01:04:39 phk Exp $ */ #include <sys/param.h> @@ -490,11 +490,14 @@ ffs_oldfscompat(fs) if (fs->fs_inodefmt < FS_44INODEFMT) { /* XXX */ quad_t sizepb = fs->fs_bsize; /* XXX */ /* XXX */ +#if 0 fs->fs_maxfilesize = fs->fs_bsize * NDADDR - 1; /* XXX */ for (i = 0; i < NIADDR; i++) { /* XXX */ sizepb *= NINDIR(fs); /* XXX */ fs->fs_maxfilesize += sizepb; /* XXX */ } /* XXX */ +#endif + fs->fs_maxfilesize = (u_quad_t) 1 << 39; fs->fs_qbmask = ~fs->fs_bmask; /* XXX */ fs->fs_qfmask = ~fs->fs_fmask; /* XXX */ } /* XXX */ |