Search Linux Wireless

Re: [PATCH 00/18] mac80211 cleanups and fixes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 11, 2008 at 10:39:37AM -0700, Johannes Berg wrote:
> On Thu, 2008-09-11 at 10:33 -0700, Luis R. Rodriguez wrote:
> > On Thu, Sep 11, 2008 at 09:53:15AM -0700, Johannes Berg wrote:
> > > On Thu, 2008-09-11 at 09:50 -0700, Luis R. Rodriguez wrote:
> > > > > I had actually tried
> > > > > (http://johannes.sipsolutions.net/patches/kernel/ath9k-sta-node.patch)
> > 
> > Just a comment so far from the patch.
> > 
> > > +     rcu_read_unlock();
> > > +
> > > +     /* the "!an" here is fine even outside RCU lock */
> > 
> > Why is that? I fail to see that.
> 
> Well take the larger bit of code:
> 
> 	struct something *an = NULL;
> 
> ...
> 
> 	rcu_read_lock();
> 	sta = ieee80211_find_sta(hw, hdr->addr2);
> 	if (sta)
> 		an = (void *) sta->drv_priv;
>  
>  	if (an) {
>  		ath_rx_input(sc, an,
>  			     hw->conf.ht_conf.ht_supported,
>  			     skb, status, &st);
>  	}
> 	rcu_read_unlock();
> 
> 	/* the "!an" here is fine even outside RCU lock */
>  	if (!an || (st != ATH_RX_CONSUMED))
>  		__ieee80211_rx(hw, skb, &rx_status);
> 
> 
> So at this point it's only checking whether above it had a pointer, it's
> not accessing it. Think of the "an" variable, after rcu_read_unlock(),
> as a bool indicating whether or not the code that just happened had
> access to the node or not.

I see now, thanks :)

  Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux