Message ID | 1281111456.2715.29.camel@localhost |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
From: David Woodhouse <dwmw2@infradead.org> Date: Fri, 06 Aug 2010 17:17:36 +0100 > We were seeing faults in the solos-pci receive tasklet when packets > arrived for a VCC which was currently being closed: ... > This patch uses an RCU-inspired approach to fix it. In the RX tasklet's > find_vcc() function we first refuse to use a VCC which already has the > ATM_VF_READY bit cleared. And in the VCC close function, we synchronise > with the tasklet to ensure that it can't still be using the VCC before > we continue and allow the VCC to be destroyed. > > Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> > Tested-by: Nathan Williams <nathan@traverse.com.au> > Cc: stable@kernel.org Applied, thanks David. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c index c5f5186..a73f102 100644 --- a/drivers/atm/solos-pci.c +++ b/drivers/atm/solos-pci.c @@ -774,7 +774,8 @@ static struct atm_vcc *find_vcc(struct atm_dev *dev, short vpi, int vci) sk_for_each(s, node, head) { vcc = atm_sk(s); if (vcc->dev == dev && vcc->vci == vci && - vcc->vpi == vpi && vcc->qos.rxtp.traffic_class != ATM_NONE) + vcc->vpi == vpi && vcc->qos.rxtp.traffic_class != ATM_NONE && + test_bit(ATM_VF_READY, &vcc->flags)) goto out; } vcc = NULL; @@ -900,6 +901,10 @@ static void pclose(struct atm_vcc *vcc) clear_bit(ATM_VF_ADDR, &vcc->flags); clear_bit(ATM_VF_READY, &vcc->flags); + /* Hold up vcc_destroy_socket() (our caller) until solos_bh() in the + tasklet has finished processing any incoming packets (and, more to + the point, using the vcc pointer). */ + tasklet_unlock_wait(&card->tlet); return; }