From: Doug Nazar <nazard@nazar.ca>
To: Linus Torvalds <torvalds@linux-foundation.org>,
Al Viro <viro@zeniv.linux.org.uk>
Cc: 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: Wed, 23 Aug 2017 15:53:44 -0400 [thread overview]
Message-ID: <ae3c9d95-5af1-eb2d-c0c1-32ae622f6c54@nazar.ca> (raw)
In-Reply-To: <CA+55aFzukw-6m0vtm6jDn4kXyfcUQbDFSwt1OOoa9nwG6toycQ@mail.gmail.com>
On 8/23/17 3:37 PM, Linus Torvalds wrote:
> On Wed, Aug 23, 2017 at 12:15 PM, Doug Nazar <nazard@nazar.ca> wrote:
>> The following commits cause short reads of block devices, however writes are
>> still allowed.
>>
>> c2a9737f45e2 ("vfs,mm: fix a dead loop in truncate_inode_pages_range()")
>> d05c5f7ba164 ("vfs,mm: fix return value of read() at s_maxbytes")
>>
>> When e2fsck sees this, it thinks it's a bad sector and tries to write a
>> block of nulls which overwrites the valid data.
> Hmm. Block devices shouldn't have issues with s_maxbytes, and I'm
> surprised that nobody has seen that before.
>
>> Device is LVM over 2 x RAID-5 on an old 32bit desktop.
>>
>> RO RA SSZ BSZ StartSec Size Device
>> rw 4096 512 4096 0 9748044840960 /dev/Storage/Main
> .. and the problem may be as simple as just a missing initialization
> of s_maxbytes for blockdev_superblock.
>
> Does the attcahed trivial one-liner fix things for you?
>
> Al, if it really is this simple, how come nobody even noticed?
>
> Also, I do wonder if that check in do_generic_file_read() should just
> unconditionally use MAX_LFS_FILESIZE, since the whole point there is
> really about the index wrap-around, not about any underlying
> filesystem limits per se.
>
> And that's exactly what MAX_LFS_FILESIZE is - the maximum size that
> fits in the page index.
It's compiling now, but I think it's already set to MAX_LFS_FILESIZE.
[ 169.095127] ppos=80180006000, s_maxbytes=7ffffffffff,
magic=0x62646576, type=bdev
Doug
next prev parent reply other threads:[~2017-08-23 19:53 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 [this message]
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
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=ae3c9d95-5af1-eb2d-c0c1-32ae622f6c54@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®