Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1719108

Re: Kernels v4.9+ cause short reads of block devices

From Doug Nazar <nazard@nazar.ca>
Newsgroups linux.kernel
Subject Re: Kernels v4.9+ cause short reads of block devices
Date 2017-08-24 12:10 +0200
Message-ID <uhXfk-52T-19@gated-at.bofh.it> (permalink)
References <uhJFq-4ES-55@gated-at.bofh.it> <uhJFq-4ES-53@gated-at.bofh.it> <uhJYK-4LE-15@gated-at.bofh.it> <uhKi6-59l-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: Kernels v4.9+ cause short reads of block devices Linus Torvalds <torvalds@linux-foundation.org> - 2017-08-23 21:40 +0200
  Re: Kernels v4.9+ cause short reads of block devices Doug Nazar <nazard@nazar.ca> - 2017-08-23 22:00 +0200
    Re: Kernels v4.9+ cause short reads of block devices Linus Torvalds <torvalds@linux-foundation.org> - 2017-08-23 22:20 +0200
      Re: Kernels v4.9+ cause short reads of block devices Andreas Dilger <adilger@dilger.ca> - 2017-08-23 23:10 +0200
        Re: Kernels v4.9+ cause short reads of block devices Doug Nazar <nazard@nazar.ca> - 2017-08-24 12:30 +0200
          Re: Kernels v4.9+ cause short reads of block devices Dave Kleikamp <dave.kleikamp@oracle.com> - 2017-08-24 17:30 +0200
      Re: Kernels v4.9+ cause short reads of block devices Doug Nazar <nazard@nazar.ca> - 2017-08-24 12:10 +0200

csiph-web