diff options
author | iedowse <iedowse@FreeBSD.org> | 2002-06-26 18:34:51 +0000 |
---|---|---|
committer | iedowse <iedowse@FreeBSD.org> | 2002-06-26 18:34:51 +0000 |
commit | c0323a07fb64ca28dea948838fdbcdfb6567eec8 (patch) | |
tree | fd006436ff99e2e311741b91f06697f4c2d9ecee | |
parent | c8f207f89f5cbbfd10791f54508afe1be8f5ea6e (diff) | |
download | FreeBSD-src-c0323a07fb64ca28dea948838fdbcdfb6567eec8.zip FreeBSD-src-c0323a07fb64ca28dea948838fdbcdfb6567eec8.tar.gz |
Remove the kernel file-size limit for UFS2, so that only the limit
imposed by the filesystem structure itself remains. With 16k blocks,
the maximum file size is now just over 128TB.
For now, the UFS1 file size limit is left unchanged so as to remain
consistent with RELENG_4, but it too could be removed in the future.
Reviewed by: mckusick
-rw-r--r-- | sbin/fsck_ffs/pass1.c | 5 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 12 |
2 files changed, 11 insertions, 6 deletions
diff --git a/sbin/fsck_ffs/pass1.c b/sbin/fsck_ffs/pass1.c index 6562155..4a7fd54 100644 --- a/sbin/fsck_ffs/pass1.c +++ b/sbin/fsck_ffs/pass1.c @@ -221,7 +221,10 @@ checkinode(ino_t inumber, struct inodesc *idesc) } lastino = inumber; /* This should match the file size limit in ffs_mountfs(). */ - kernmaxfilesize = (off_t)0x40000000 * sblock.fs_bsize - 1; + if (sblock.fs_magic == FS_UFS1_MAGIC) + kernmaxfilesize = (off_t)0x40000000 * sblock.fs_bsize - 1; + else + kernmaxfilesize = sblock.fs_maxfilesize; if (DIP(dp, di_size) > kernmaxfilesize || DIP(dp, di_size) > sblock.fs_maxfilesize || (mode == IFDIR && DIP(dp, di_size) > MAXDIRSIZE)) { diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index f3fe627..61cec1f 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -853,10 +853,12 @@ ffs_oldfscompat_read(fs, ump, sblockloc) fs->fs_qbmask = ~fs->fs_bmask; fs->fs_qfmask = ~fs->fs_fmask; } - ump->um_savedmaxfilesize = fs->fs_maxfilesize; - maxfilesize = (u_int64_t)0x40000000 * fs->fs_bsize - 1; - if (fs->fs_maxfilesize > maxfilesize) - fs->fs_maxfilesize = maxfilesize; + if (fs->fs_magic == FS_UFS1_MAGIC) { + ump->um_savedmaxfilesize = fs->fs_maxfilesize; + maxfilesize = (u_int64_t)0x40000000 * fs->fs_bsize - 1; + if (fs->fs_maxfilesize > maxfilesize) + fs->fs_maxfilesize = maxfilesize; + } /* Compatibility for old filesystems */ if (fs->fs_avgfilesize <= 0) fs->fs_avgfilesize = AVFILESIZ; @@ -890,8 +892,8 @@ ffs_oldfscompat_write(fs, ump) fs->fs_old_cstotal.cs_nbfree = fs->fs_cstotal.cs_nbfree; fs->fs_old_cstotal.cs_nifree = fs->fs_cstotal.cs_nifree; fs->fs_old_cstotal.cs_nffree = fs->fs_cstotal.cs_nffree; + fs->fs_maxfilesize = ump->um_savedmaxfilesize; } - fs->fs_maxfilesize = ump->um_savedmaxfilesize; if (bigcgs) { fs->fs_cgsize = fs->fs_save_cgsize; fs->fs_save_cgsize = 0; |