Re: [PATCH] (1/8) Eliminate brlock in psnap

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

 



Hi,

On 11 Mar 2003, Stephen Hemminger wrote:

>  void unregister_snap_client(struct datalink_proto *proto)
>  {
> -	br_write_lock_bh(BR_NETPROTO_LOCK);
> +	static RCU_HEAD(snap_rcu);
>  
> -	list_del(&proto->node);
> -	kfree(proto);
> +	spin_lock_bh(&snap_lock);
> +	list_del_rcu(&proto->node);
> +	spin_unlock_bh(&snap_lock);
>  
> -	br_write_unlock_bh(BR_NETPROTO_LOCK);
> +	call_rcu(&snap_rcu, (void (*)(void *)) kfree, proto);
>  }

Is this really correct? What happens with snap_rcu, if 
unregister_snap_client is called again, before the call_rcu callback 
finished?

bye, Roman

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux