[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1403398834.2177.41.camel@dabdike.int.hansenpartnership.com>
Date: Sat, 21 Jun 2014 18:00:34 -0700
From: James Bottomley <James.Bottomley@...senPartnership.com>
To: Al Viro <viro@...IV.linux.org.uk>
Cc: Theodore Ts'o <tytso@....edu>, Dave Chinner <david@...morbit.com>,
Jens Axboe <axboe@...com>, linux-kernel@...r.kernel.org,
linux-scsi@...r.kernel.org
Subject: Re: 32-bit bug in iovec iterator changes
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.
> >
> > True ... figured this out 10 seconds after sending the email.
> >
> > > * assignment converts count to size_t, which *would* truncate for
> > > values that are greater than the maximal value representable by size_t.
> > > But in that case it's by definition greater than i->count, so we do not
> > > reach that assignment at all.
> >
> > OK, so what I still don't get is why isn't the compiler warning when we
> > truncate a u64 to a u32? We should get that warning in your new code,
> > and we should have got that warning in fs/block_dev.c where it would
> > have pinpointed the actual problem.
>
> In which universe?
>
> extern void f(unsigned int);
>
> void g(unsigned long x)
> {
> f(x);
> }
In the one where the code is compiled with -Wconversion ... I'm just
surprised, I thought we had this enabled.
James
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists