Re: [PATCH 1/3] relay: Fix 4 off-by-one errors occuring whenwriting to a CPU buffer.

From: Eduard - Gabriel Munteanu
Date: Wed Jul 30 2008 - 13:50:50 EST


On Thu, Jul 24, 2008 at 12:09:36AM -0500, Tom Zanussi wrote:
>
> On Sat, 2008-06-21 at 05:06 +0300, Eduard - Gabriel Munteanu wrote:
> > On Mon, 16 Jun 2008 00:22:27 -0500
> > Tom Zanussi <tzanussi@xxxxxxxxx> wrote:
> >
> > > So apparently what you're seeing is zeroes being read when there's a
> > > buffer-full condition? If so, we need to figure out exactly why
> > > that's happening to see whether your fix is really what's needed; I
> > > haven't seen problems in the buffer-full case before and I think your
> > > fix would break it even if it fixed your read problem. So it would
> > > be good to be able to reproduce it first.
> > >
> > > Tom
> >
> > Hi,
> >
> > Sorry for being so late, there were some exams I had to cope with.
> >
> > Although I couldn't reproduce zeros, I've come up with something I'd
> > say is equally good. This has been done on a vanilla 2.6.26-rc6.
> >
> > Please look at the testcase below and tell me what you think.
> >
>
> Hi,
>
> Yes, this is a bug - thanks for sending the nice test case. This patch
> should fix it. BTW, if the output still looks a little different from
> what you were expecting, it might make more sense after adding a
> relay_test printk for each dropped event, something like this:

The all-zeros problem happened when poll() with infinite timeout is not
used before reading. I fixed the user app I was writing, but the docs should
really reflect this. Relay has a kinda strange interface.


Cheers,
Eduard

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/