From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751507AbdH0TzC (ORCPT ); Sun, 27 Aug 2017 15:55:02 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:34450 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751300AbdH0TzB (ORCPT ); Sun, 27 Aug 2017 15:55:01 -0400 Subject: Re: Kernels v4.9+ cause short reads of block devices To: Linus Torvalds , Andreas Dilger Cc: Doug Nazar , Al Viro , Linux Kernel Mailing List , Wei Fang , linux-fsdevel , Mark Fasheh , Joel Becker , Dave Kleikamp References: <1ae53e17-e455-4f17-0280-b0dae183a449@nazar.ca> From: Dave Kleikamp Message-ID: <371f0acc-2385-f026-f017-b80cdce305f0@oracle.com> Date: Sun, 27 Aug 2017 14:54:10 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/27/2017 02:47 PM, Linus Torvalds wrote: > 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. I'll submit a patch to clean up jfs. Thanks, Shaggy > > Linus >