Return-Path: Received: from mail-pg0-f68.google.com ([74.125.83.68]:35953 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751170AbdFDXXY (ORCPT ); Sun, 4 Jun 2017 19:23:24 -0400 Received: by mail-pg0-f68.google.com with SMTP id v18so4475690pgb.3 for ; Sun, 04 Jun 2017 16:23:24 -0700 (PDT) Date: Sun, 4 Jun 2017 16:23:18 -0700 (PDT) From: Richard Narron To: Linus Torvalds cc: Al Viro , Will B , Theodore Ts'o , linux-fsdevel Subject: [PATCH 1/1] fs/ufs: Set UFS default maximum bytes per file In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 --------------------------------------------------------------------- --- 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"); ---------------------------------------------------------------------