Re: [PATCH][ATM] cli() for net/atm/lec.c

From: romieu@fr.zoreil.com
Date: Thu Feb 20 2003 - 17:11:55 EST


chas williams <chas@locutus.cmf.nrl.navy.mil> :
[...]
> @@ -2175,22 +2173,21 @@
> }
> if (!entry) {
> DPRINTK("LEC_ARP: Arp_check_empties: entry not found!\n");
> - lec_arp_unlock(priv);
> + lec_arp_put(priv);
> return;
> }
> - save_flags(flags);
> - cli();
> + LEC_ARP_LOCK();
> del_timer(&entry->timer);
> memcpy(entry->mac_addr, src, ETH_ALEN);
> entry->status = ESI_FORWARD_DIRECT;
> entry->last_used = jiffies;
> prev->next = entry->next;
> - restore_flags(flags);
> + LEC_ARP_UNLOCK();

It isn't completely trivial that the prev <-> entry relationship
still holds at the point where LEC_ARP_LOCK() is called. Widening
the protected region would spare some brain cycles imho.

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



This archive was generated by hypermail 2b29 : Sun Feb 23 2003 - 22:00:31 EST