aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Narron <comet.berkeley@gmail.com>2017-06-04 19:23:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-06-04 19:33:54 -0400
commit239e250e4acbc0104d514307029c0839e834a51a (patch)
treeccc60a7da7595267709fc5d36acc6043c2832bae
parent125f42b0e226d201a2118b79a6c7f1ddb9aabe1d (diff)
fs/ufs: Set UFS default maximum bytes per file
This fixes a problem with reading files larger than 2GB from a UFS-2 file system: https://bugzilla.kernel.org/show_bug.cgi?id=195721 The incorrect UFS s_maxsize limit became a problem as of commit c2a9737f45e2 ("vfs,mm: fix a dead loop in truncate_inode_pages_range()") which started using s_maxbytes to avoid a page index overflow in do_generic_file_read(). That caused files to be truncated on UFS-2 file systems because the default maximum file size is 2GB (MAX_NON_LFS) and UFS didn't update it. Here I simply increase the default to a common value used by other file systems. Signed-off-by: Richard Narron <comet.berkeley@gmail.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Will B <will.brokenbourgh2877@gmail.com> Cc: Theodore Ts'o <tytso@mit.edu> Cc: <stable@vger.kernel.org> # v4.9 and backports of c2a9737f45e2 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--fs/ufs/super.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index 131b2b77c818..29ecaf739449 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -812,9 +812,8 @@ static int ufs_fill_super(struct super_block *sb, void *data, int silent)
812 uspi->s_dirblksize = UFS_SECTOR_SIZE; 812 uspi->s_dirblksize = UFS_SECTOR_SIZE;
813 super_block_offset=UFS_SBLOCK; 813 super_block_offset=UFS_SBLOCK;
814 814
815 /* Keep 2Gig file limit. Some UFS variants need to override 815 sb->s_maxbytes = MAX_LFS_FILESIZE;
816 this but as I don't know which I'll let those in the know loosen 816
817 the rules */
818 switch (sbi->s_mount_opt & UFS_MOUNT_UFSTYPE) { 817 switch (sbi->s_mount_opt & UFS_MOUNT_UFSTYPE) {
819 case UFS_MOUNT_UFSTYPE_44BSD: 818 case UFS_MOUNT_UFSTYPE_44BSD:
820 UFSD("ufstype=44bsd\n"); 819 UFSD("ufstype=44bsd\n");