Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751355AbdH0TrG (ORCPT ); Sun, 27 Aug 2017 15:47:06 -0400 Received: from mail-it0-f49.google.com ([209.85.214.49]:35802 "EHLO mail-it0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751277AbdH0TrE (ORCPT ); Sun, 27 Aug 2017 15:47:04 -0400 MIME-Version: 1.0 In-Reply-To: References: <1ae53e17-e455-4f17-0280-b0dae183a449@nazar.ca> From: Linus Torvalds Date: Sun, 27 Aug 2017 12:47:03 -0700 X-Google-Sender-Auth: aYuI9mnyMaosJNeyV8BlYJ3R-Oo Message-ID: Subject: Re: Kernels v4.9+ cause short reads of block devices To: Andreas Dilger Cc: Doug Nazar , Al Viro , Linux Kernel Mailing List , Wei Fang , linux-fsdevel , Mark Fasheh , Joel Becker , Dave Kleikamp Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1267 Lines: 33 On Wed, Aug 23, 2017 at 2:01 PM, Andreas Dilger wrote: > > Doug, > I noticed while checking for other implications of changing MAX_LFS_FILESIZE > that fs/jfs/super.c is also working around this limit. Note to people: I just committed the patch to update MAX_LFS_FILESIZE. I made it use the simpler (and clearer) calculation of ((loff_t)ULONG_MAX << PAGE_SHIFT) for the 32-bit case, and I did *not* change any other users. The jfs comment was a bit confusing, and talks about "wraps around" at 8TB, when that actually happens at 16TB. Yes, if you use a signed number for the index, it does wrap at 8TB, but you really shouldn't (and the code the jfs comment points to doesn't). So I didn't touch that. Nor did I touch: > it also makes sense to fix jfs_fill_super() to > use MAX_LFS_FILESIZE instead of JFS rolling its own, something like: > > /* logical blocks are represented by 40 bits in pxd_t, etc. > * and page cache is indexed by long. */ > sb->s_maxbytes = min((u64)sb->s_blocksize) << 40, > MAX_LFS_FILESIZE); which I agree should be modified. The new MAX_LFS_FILESIZE should be the right size, but the difference now is only one page less one byte. Linus