summaryrefslogtreecommitdiffstats
path: root/sys/gnu/ext2fs/ext2_inode.c
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2004-02-19 09:06:06 +0000
committertjr <tjr@FreeBSD.org>2004-02-19 09:06:06 +0000
commitd2df6bc6f718fb3b4771f1057489a9370b4155cb (patch)
treeaac5f0575afb893455deb9cc3f4f5c2879b19a06 /sys/gnu/ext2fs/ext2_inode.c
parent4583be830a6ae7272e015769b97449f07c914bac (diff)
downloadFreeBSD-src-d2df6bc6f718fb3b4771f1057489a9370b4155cb.zip
FreeBSD-src-d2df6bc6f718fb3b4771f1057489a9370b4155cb.tar.gz
Enforce the file size limit in VOP_WRITE() as well as VOP_TRUNCATE();
pointed out by bde.
Diffstat (limited to 'sys/gnu/ext2fs/ext2_inode.c')
-rw-r--r--sys/gnu/ext2fs/ext2_inode.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/sys/gnu/ext2fs/ext2_inode.c b/sys/gnu/ext2fs/ext2_inode.c
index d940a5c..5b5eb83 100644
--- a/sys/gnu/ext2fs/ext2_inode.c
+++ b/sys/gnu/ext2fs/ext2_inode.c
@@ -164,15 +164,7 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length);
* value of oszie is 0, length will be at least 1.
*/
if (osize < length) {
- /*
- * XXX Refuse to extend files past 2GB on old format
- * filesystems or ones that don't already have the
- * large file flag set in the superblock.
- */
- if (osize < 0x8000000 && length >= 0x80000000 &&
- (oip->i_e2fs->s_es->s_rev_level == EXT2_GOOD_OLD_REV ||
- (oip->i_e2fs->s_es->s_feature_ro_compat &
- EXT2_FEATURE_RO_COMPAT_LARGE_FILE) == 0))
+ if (length > oip->i_e2fs->fs_maxfilesize)
return (EFBIG);
offset = blkoff(fs, length - 1);
lbn = lblkno(fs, length - 1);
OpenPOWER on IntegriCloud