1 May 2007 02:20
Re: [PATCH] fix a race between tx and rx paths
On Fri, Apr 27, 2007 at 09:43:39AM +0200, Guennadi Liakhovetski wrote:
> On Fri, 27 Apr 2007, Samuel Ortiz wrote:
> > After looking a bit more carefully at it, I have a remark regarding this
> > patch:
> >
> > > > diff -p -u -r1.1.1.8.4.1 irlap_frame.c
> > > > --- a/net/irda/irlap_frame.c 2 Apr 2007 10:36:28 -0000 1.1.1.8.4.1
> > > > +++ b/net/irda/irlap_frame.c 19 Apr 2007 13:20:36 -0000
> > > > <at> <at> -796,6 +796,7 <at> <at> void irlap_send_data_primary_poll(struct
> > > > self->vs = (self->vs + 1) % 8;
> > > > self->ack_required = FALSE;
> > > >
> > > > + irlap_next_state(self, LAP_NRM_P);
> > > > irlap_send_i_frame(self, tx_skb, CMD_FRAME);
> > > > } else {
> > > > IRDA_DEBUG(4, "%s(), sending unreliable frame\n", __FUNCTION__);
> > > > <at> <at> -808,6 +809,7 <at> <at> void irlap_send_data_primary_poll(struct
> > > > skb->data[1] |= PF_BIT;
> > > > irlap_send_ui_frame(self, skb_get(skb), self->caddr, CMD_FRAME);
> > > > }
> > > > + irlap_next_state(self, LAP_NRM_P);
> > > > }
> > Here you're calling irlap_next_state() after the last frame has been sent.
> > If irlap_send_data_primary_poll() gets preempted, and we receive the peer's
> > answer before we call irlap_next_state(), then we may hit the same bug you are
> > trying to fix.
>
> Yes, I know. It was a deliberate decision. I couldn't reproduce a race in
> those branches, and, therefore couldn't test any fix. So, I preferred to
> go the "least impact" way.
(Continue reading)
), otherwise it oopses.
good catch, again...Yes, I do remember the irttp_dup bug
> Generally, I like your patch better than mine to ppp_generic.c, where I
> explicitly check if a recursion is occurring. Still, I am a bit concerned
> about introducing yet another execution context into irda... We have seen
> a couple of locking issues there already in the last 2-3 months especially
> under rt-preempt... Would you be able to run some tests too?
I think I can run some tests here as well, but probably not as many as you:
I'm not doing IrDA stuff full time while it seems you currently are.
But I will definitely spend some time this week running my IrDA stack with this
patch applied. I didn't bother to do that earlier as you first reported some
oops with this patch applied.
> I will be
RSS Feed