[PATCH 1/1] fs/ufs: Set UFS default maximum bytes per file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch is a response to a problem with reading files larger than 2GB from a UFS-2 file system:

https://bugzilla.kernel.org/show_bug.cgi?id=195721

The problem was started with a patch to Linux 4.8.4 mm/filemap.c to fix a truncation problem:

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?h=linux-4.8.y&id=3d549dcfbbb0ecdaa571431a27ee5da9f2466716

which truncates UFS-2 file systems because the default maximum file size is 2GB (MAX_NON_LFS)

Here I simply increase the default to a common value used by other file systems.

Signed-off-by: Richard Narron <comet.berkeley@xxxxxxxxx>
---------------------------------------------------------------------
--- a/fs/ufs/super.c.orig	2017-05-28 17:20:53.000000000 -0700
+++ b/fs/ufs/super.c	2017-06-03 17:08:33.340100262 -0700
@@ -812,9 +812,8 @@ static int ufs_fill_super(struct super_b
 	uspi->s_dirblksize = UFS_SECTOR_SIZE;
 	super_block_offset=UFS_SBLOCK;

-	/* Keep 2Gig file limit. Some UFS variants need to override
-	   this but as I don't know which I'll let those in the know loosen
-	   the rules */
+        sb->s_maxbytes = MAX_LFS_FILESIZE;
+
 	switch (sbi->s_mount_opt & UFS_MOUNT_UFSTYPE) {
 	case UFS_MOUNT_UFSTYPE_44BSD:
 		UFSD("ufstype=44bsd\n");

---------------------------------------------------------------------





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux