From: Doug Nazar <nazard@nazar.ca>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Wei Fang <fangwei1@huawei.com>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: Kernels v4.9+ cause short reads of block devices
Date: Thu, 24 Aug 2017 06:03:33 -0400 [thread overview]
Message-ID: <706d597b-37bd-7725-a164-9e2b19255fac@nazar.ca> (raw)
In-Reply-To: <CA+55aFzWCSU6A0xmG+TC+K-tN3tZTOo_0dxYy5k=5K+DeTEx8A@mail.gmail.com>
On 8/23/17 4:13 PM, Linus Torvalds wrote:
> Oh, right you are - I'm much too used to 64-bit, where
> MAX_LFS_FILESIZE is basically infinite, and was jusr assuming that it
> was something like the UFS bug we had not that long ago that was due
> to the 32-bit limit.
>
> But yes, on 32-bit, we are limited by the 32-bit index into the page
> cache, and we limit the index to 31 bits too, so we have (PAGE_SIZE <<
> 31) -1, which is that 7ffffffffff.
Yeah, it's an old organically grown storage server (install images, old
vms, etc.) that
I can't convince myself it's worth upgrading.
> The *right* patch is likely to just this instead:
>
> -#define MAX_LFS_FILESIZE (((loff_t)PAGE_SIZE << (BITS_PER_LONG-1))-1)
> +#define MAX_LFS_FILESIZE (((loff_t)PAGE_SIZE <<
> BITS_PER_LONG)-PAGE_SIZE)
>
> which should make MAX_LFS_FILESIZE be 0xffffffff000 and you disk size
> should be ok.
That solves my issue. I'm curious if that check should also be in the
write path. If the
check had been there too I wouldn't have ended up with any corruption.
I'm not sure if anything over 16TB will create/assemble (or if anybody
else is crazy like me).
Doug
prev parent reply other threads:[~2017-08-24 10:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-23 19:15 Doug Nazar
2017-08-23 19:37 ` Linus Torvalds
2017-08-23 19:53 ` Doug Nazar
2017-08-23 20:13 ` Linus Torvalds
2017-08-23 21:01 ` Andreas Dilger
2017-08-24 10:20 ` Doug Nazar
2017-08-24 15:22 ` Dave Kleikamp
2017-08-27 19:47 ` Linus Torvalds
2017-08-27 19:54 ` Dave Kleikamp
2017-08-29 10:40 ` Doug Nazar
2017-08-24 10:03 ` Doug Nazar [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=706d597b-37bd-7725-a164-9e2b19255fac@nazar.ca \
--to=nazard@nazar.ca \
--cc=fangwei1@huawei.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®