]> git.proxmox.com Git - mirror_spl-debian.git/commit - module/spl/spl-tsd.c
Fix tsd_get/set() race with tsd_exit/destroy()
authorBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 31 Jan 2013 20:59:39 +0000 (12:59 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 31 Jan 2013 21:54:59 +0000 (13:54 -0800)
commit6ef94aa67a48792d98b76152661743e42c23a03f
treebe13daa8d2956061bd2df20471ebc8fbdb5234fa
parentde081a2ab4e911d2308b4f4055558f1d666f6b63
Fix tsd_get/set() race with tsd_exit/destroy()

The tsd_exit() and tsd_destroy() functions remove entries from
hash bins without taking the hash bin lock.  They do take the
table lock, but tsd_get() and tsd_set() only take the hash bin
lock to allow for maximum concurency.

The result is that while tsd_get() and tsd_set() are traversing
the hash bin list it can be modified by another thread in which
happens to hash to the same value.  To avoid this add the needed
locking to tsd_exit() and tsd_destroy().

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #174
module/spl/spl-tsd.c