Commit 9fcaaa87 authored by Richard Narron's avatar Richard Narron Committed by Sasha Levin

fs/ufs: Set UFS default maximum bytes per file

[ Upstream commit 239e250e ]

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
c2a9737f ("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: default avatarRichard 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 c2a9737fSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
parent b36188f2
...@@ -831,9 +831,8 @@ static int ufs_fill_super(struct super_block *sb, void *data, int silent) ...@@ -831,9 +831,8 @@ static int ufs_fill_super(struct super_block *sb, void *data, int silent)
uspi->s_dirblksize = UFS_SECTOR_SIZE; uspi->s_dirblksize = UFS_SECTOR_SIZE;
super_block_offset=UFS_SBLOCK; super_block_offset=UFS_SBLOCK;
/* Keep 2Gig file limit. Some UFS variants need to override sb->s_maxbytes = MAX_LFS_FILESIZE;
this but as I don't know which I'll let those in the know loosen
the rules */
switch (sbi->s_mount_opt & UFS_MOUNT_UFSTYPE) { switch (sbi->s_mount_opt & UFS_MOUNT_UFSTYPE) {
case UFS_MOUNT_UFSTYPE_44BSD: case UFS_MOUNT_UFSTYPE_44BSD:
UFSD("ufstype=44bsd\n"); UFSD("ufstype=44bsd\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment