Re: [regression] fix 32-bit breakage in block device read(2) (was Re: 32-bit bug in iovec iterator changes)

2014-06-26 Thread Bruno Wolff III
On Mon, Jun 23, 2014 at 08:44:40 +0100, Al Viro wrote: blkdev_read_iter() wants to cap the iov_iter by the amount of data remaining to the end of device. That's what iov_iter_truncate() is for (trim iter->count if it's above the given limit). So far, so good, but the argument of

Re: [regression] fix 32-bit breakage in block device read(2) (was Re: 32-bit bug in iovec iterator changes)

2014-06-26 Thread Bruno Wolff III
On Mon, Jun 23, 2014 at 08:44:40 +0100, Al Viro v...@zeniv.linux.org.uk wrote: blkdev_read_iter() wants to cap the iov_iter by the amount of data remaining to the end of device. That's what iov_iter_truncate() is for (trim iter-count if it's above the given limit). So far, so good, but the

Re: [regression] fix 32-bit breakage in block device read(2) (was Re: 32-bit bug in iovec iterator changes)

2014-06-25 Thread Linus Torvalds
Al, just checking - did you expect me to take this from the email, or are you preparing a pull request? Linus On Mon, Jun 23, 2014 at 12:44 AM, Al Viro wrote: > > OK, here it is, hopefully with sufficient comments: -- To unsubscribe from this list: send the line "unsubscribe

Re: [regression] fix 32-bit breakage in block device read(2) (was Re: 32-bit bug in iovec iterator changes)

2014-06-25 Thread Linus Torvalds
Al, just checking - did you expect me to take this from the email, or are you preparing a pull request? Linus On Mon, Jun 23, 2014 at 12:44 AM, Al Viro v...@zeniv.linux.org.uk wrote: OK, here it is, hopefully with sufficient comments: -- To unsubscribe from this list: send the

Re: [regression] fix 32-bit breakage in block device read(2) (was Re: 32-bit bug in iovec iterator changes)

2014-06-24 Thread One Thousand Gnomes
On Mon, 23 Jun 2014 11:43:02 -0400 "Theodore Ts'o" wrote: > On Mon, Jun 23, 2014 at 08:44:40AM +0100, Al Viro wrote: > > > > OK, here it is, hopefully with sufficient comments: > > The comments look really good. I assume you'll get this to > Linus in time for 3.16-rc3? Fixes the 32GB 'can't

Re: [regression] fix 32-bit breakage in block device read(2) (was Re: 32-bit bug in iovec iterator changes)

2014-06-24 Thread One Thousand Gnomes
On Mon, 23 Jun 2014 11:43:02 -0400 Theodore Ts'o ty...@mit.edu wrote: On Mon, Jun 23, 2014 at 08:44:40AM +0100, Al Viro wrote: OK, here it is, hopefully with sufficient comments: The comments look really good. I assume you'll get this to Linus in time for 3.16-rc3? Fixes the 32GB

Re: [regression] fix 32-bit breakage in block device read(2) (was Re: 32-bit bug in iovec iterator changes)

2014-06-23 Thread Theodore Ts'o
On Mon, Jun 23, 2014 at 08:44:40AM +0100, Al Viro wrote: > > OK, here it is, hopefully with sufficient comments: The comments look really good. I assume you'll get this to Linus in time for 3.16-rc3? Many thanks!! - Ted -- To unsubscribe from this list:

[regression] fix 32-bit breakage in block device read(2) (was Re: 32-bit bug in iovec iterator changes)

2014-06-23 Thread Al Viro
On Sun, Jun 22, 2014 at 07:50:07AM -0400, Theodore Ts'o wrote: > On Sun, Jun 22, 2014 at 02:00:32AM +0100, Al Viro wrote: > > > > PS: I agree that it's worth careful commenting, obviously, but > > before sending it to Linus (*with* comments) I want to get a > > confirmation that this one-liner

Re: [regression] fix 32-bit breakage in block device read(2) (was Re: 32-bit bug in iovec iterator changes)

2014-06-23 Thread Theodore Ts'o
On Mon, Jun 23, 2014 at 08:44:40AM +0100, Al Viro wrote: OK, here it is, hopefully with sufficient comments: The comments look really good. I assume you'll get this to Linus in time for 3.16-rc3? Many thanks!! - Ted -- To unsubscribe from this list:

[regression] fix 32-bit breakage in block device read(2) (was Re: 32-bit bug in iovec iterator changes)

2014-06-23 Thread Al Viro
On Sun, Jun 22, 2014 at 07:50:07AM -0400, Theodore Ts'o wrote: On Sun, Jun 22, 2014 at 02:00:32AM +0100, Al Viro wrote: PS: I agree that it's worth careful commenting, obviously, but before sending it to Linus (*with* comments) I want to get a confirmation that this one-liner actually

Re: 32-bit bug in iovec iterator changes

2014-06-22 Thread Theodore Ts'o
On Sun, Jun 22, 2014 at 02:00:32AM +0100, Al Viro wrote: > > PS: I agree that it's worth careful commenting, obviously, but > before sending it to Linus (*with* comments) I want to get a > confirmation that this one-liner actually fixes what Ted is seeing. > I have reproduced it here, and that

Re: 32-bit bug in iovec iterator changes

2014-06-22 Thread Theodore Ts'o
On Sun, Jun 22, 2014 at 02:00:32AM +0100, Al Viro wrote: PS: I agree that it's worth careful commenting, obviously, but before sending it to Linus (*with* comments) I want to get a confirmation that this one-liner actually fixes what Ted is seeing. I have reproduced it here, and that change

Re: 32-bit bug in iovec iterator changes

2014-06-21 Thread Al Viro
On Sun, Jun 22, 2014 at 01:53:52AM +0100, Al Viro wrote: > On Sat, Jun 21, 2014 at 05:32:44PM -0700, James Bottomley wrote: > > > No, we are not. Look: > > > * comparison promotes both operands to u64 here, so its result is > > > accurate, no matter how large count is. They are compared as

Re: 32-bit bug in iovec iterator changes

2014-06-21 Thread James Bottomley
On Sun, 2014-06-22 at 01:53 +0100, Al Viro wrote: > On Sat, Jun 21, 2014 at 05:32:44PM -0700, James Bottomley wrote: > > > No, we are not. Look: > > > * comparison promotes both operands to u64 here, so its result is > > > accurate, no matter how large count is. They are compared as natural >

Re: 32-bit bug in iovec iterator changes

2014-06-21 Thread Al Viro
On Sat, Jun 21, 2014 at 05:32:44PM -0700, James Bottomley wrote: > > No, we are not. Look: > > * comparison promotes both operands to u64 here, so its result is > > accurate, no matter how large count is. They are compared as natural > > numbers. > > True ... figured this out 10 seconds

Re: 32-bit bug in iovec iterator changes

2014-06-21 Thread James Bottomley
On Sun, 2014-06-22 at 01:26 +0100, Al Viro wrote: > On Sat, Jun 21, 2014 at 05:03:20PM -0700, James Bottomley wrote: > > > > Anyway, does the following alone fix the problem you are seeing? > > > > > > diff --git a/include/linux/uio.h b/include/linux/uio.h > > > index ddfdb53..dbb02d4 100644 > >

Re: 32-bit bug in iovec iterator changes

2014-06-21 Thread Al Viro
On Sat, Jun 21, 2014 at 05:03:20PM -0700, James Bottomley wrote: > > Anyway, does the following alone fix the problem you are seeing? > > > > diff --git a/include/linux/uio.h b/include/linux/uio.h > > index ddfdb53..dbb02d4 100644 > > --- a/include/linux/uio.h > > +++ b/include/linux/uio.h > >

Re: 32-bit bug in iovec iterator changes

2014-06-21 Thread James Bottomley
On Sun, 2014-06-22 at 00:49 +0100, Al Viro wrote: > On Sat, Jun 21, 2014 at 07:09:22PM -0400, Theodore Ts'o wrote: > > On Sat, Jun 21, 2014 at 06:53:07AM +0100, Al Viro wrote: > > > > > > ed include/linux/uio.h < > > /iov_iter_truncate/s/size_t/u64/ > > > w > > > q > > > EOF > > > > > > Could

Re: 32-bit bug in iovec iterator changes

2014-06-21 Thread Al Viro
On Sat, Jun 21, 2014 at 07:09:22PM -0400, Theodore Ts'o wrote: > On Sat, Jun 21, 2014 at 06:53:07AM +0100, Al Viro wrote: > > > > ed include/linux/uio.h < > /iov_iter_truncate/s/size_t/u64/ > > w > > q > > EOF > > > > Could you check if that fixes the sucker? > > The following patch (attached

Re: 32-bit bug in iovec iterator changes

2014-06-21 Thread Theodore Ts'o
On Sat, Jun 21, 2014 at 06:53:07AM +0100, Al Viro wrote: > > ed include/linux/uio.h < /iov_iter_truncate/s/size_t/u64/ > w > q > EOF > > Could you check if that fixes the sucker? The following patch (attached at the end) appears to fix the problem, but looking at uio.h, I'm completely confused

Re: 32-bit bug in iovec iterator changes

2014-06-21 Thread Theodore Ts'o
On Sat, Jun 21, 2014 at 06:53:07AM +0100, Al Viro wrote: ed include/linux/uio.h EOF /iov_iter_truncate/s/size_t/u64/ w q EOF Could you check if that fixes the sucker? The following patch (attached at the end) appears to fix the problem, but looking at uio.h, I'm completely confused

Re: 32-bit bug in iovec iterator changes

2014-06-21 Thread Al Viro
On Sat, Jun 21, 2014 at 07:09:22PM -0400, Theodore Ts'o wrote: On Sat, Jun 21, 2014 at 06:53:07AM +0100, Al Viro wrote: ed include/linux/uio.h EOF /iov_iter_truncate/s/size_t/u64/ w q EOF Could you check if that fixes the sucker? The following patch (attached at the end)

Re: 32-bit bug in iovec iterator changes

2014-06-21 Thread James Bottomley
On Sun, 2014-06-22 at 00:49 +0100, Al Viro wrote: On Sat, Jun 21, 2014 at 07:09:22PM -0400, Theodore Ts'o wrote: On Sat, Jun 21, 2014 at 06:53:07AM +0100, Al Viro wrote: ed include/linux/uio.h EOF /iov_iter_truncate/s/size_t/u64/ w q EOF Could you check if that fixes

Re: 32-bit bug in iovec iterator changes

2014-06-21 Thread Al Viro
On Sat, Jun 21, 2014 at 05:03:20PM -0700, James Bottomley wrote: Anyway, does the following alone fix the problem you are seeing? diff --git a/include/linux/uio.h b/include/linux/uio.h index ddfdb53..dbb02d4 100644 --- a/include/linux/uio.h +++ b/include/linux/uio.h @@ -94,7 +94,7

Re: 32-bit bug in iovec iterator changes

2014-06-21 Thread James Bottomley
On Sun, 2014-06-22 at 01:26 +0100, Al Viro wrote: On Sat, Jun 21, 2014 at 05:03:20PM -0700, James Bottomley wrote: Anyway, does the following alone fix the problem you are seeing? diff --git a/include/linux/uio.h b/include/linux/uio.h index ddfdb53..dbb02d4 100644 ---

Re: 32-bit bug in iovec iterator changes

2014-06-21 Thread Al Viro
On Sat, Jun 21, 2014 at 05:32:44PM -0700, James Bottomley wrote: No, we are not. Look: * comparison promotes both operands to u64 here, so its result is accurate, no matter how large count is. They are compared as natural numbers. True ... figured this out 10 seconds after sending

Re: 32-bit bug in iovec iterator changes

2014-06-21 Thread James Bottomley
On Sun, 2014-06-22 at 01:53 +0100, Al Viro wrote: On Sat, Jun 21, 2014 at 05:32:44PM -0700, James Bottomley wrote: No, we are not. Look: * comparison promotes both operands to u64 here, so its result is accurate, no matter how large count is. They are compared as natural numbers.

Re: 32-bit bug in iovec iterator changes

2014-06-21 Thread Al Viro
On Sun, Jun 22, 2014 at 01:53:52AM +0100, Al Viro wrote: On Sat, Jun 21, 2014 at 05:32:44PM -0700, James Bottomley wrote: No, we are not. Look: * comparison promotes both operands to u64 here, so its result is accurate, no matter how large count is. They are compared as natural

Re: 32-bit bug in iovec iterator changes

2014-06-20 Thread Al Viro
On Fri, Jun 20, 2014 at 11:51:44PM -0400, Theodore Ts'o wrote: > On Fri, Jun 20, 2014 at 08:38:20AM +1000, Dave Chinner wrote: > > > > Short reads are more likely a bug in all the iovec iterator stuff > > that got merged in from the vfs tree. ISTR a 32 bit-only bug in that > > stuff go past in to

32-bit bug in iovec iterator changes

2014-06-20 Thread Theodore Ts'o
On Fri, Jun 20, 2014 at 08:38:20AM +1000, Dave Chinner wrote: > > Short reads are more likely a bug in all the iovec iterator stuff > that got merged in from the vfs tree. ISTR a 32 bit-only bug in that > stuff go past in to do with not being able to partition a 32GB block > dev on a 32 bit

32-bit bug in iovec iterator changes

2014-06-20 Thread Theodore Ts'o
On Fri, Jun 20, 2014 at 08:38:20AM +1000, Dave Chinner wrote: Short reads are more likely a bug in all the iovec iterator stuff that got merged in from the vfs tree. ISTR a 32 bit-only bug in that stuff go past in to do with not being able to partition a 32GB block dev on a 32 bit system due

Re: 32-bit bug in iovec iterator changes

2014-06-20 Thread Al Viro
On Fri, Jun 20, 2014 at 11:51:44PM -0400, Theodore Ts'o wrote: On Fri, Jun 20, 2014 at 08:38:20AM +1000, Dave Chinner wrote: Short reads are more likely a bug in all the iovec iterator stuff that got merged in from the vfs tree. ISTR a 32 bit-only bug in that stuff go past in to do with