Whamcloud - gitweb
LU-3430 nrs: Fix a race condition in the ORR policy 62/8162/2
authorBob Glossman <bob.glossman@intel.com>
Mon, 4 Nov 2013 16:33:16 +0000 (08:33 -0800)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 6 Nov 2013 15:10:23 +0000 (15:10 +0000)
commit2bae04d48c6410c5498a71ec95a70dcd70c4cf22
tree9d9031b08b242caacff2e6b9d8922c769b57e644
parent5d5b06e418f1d4a88afdc932e38a5a285347bcae
LU-3430 nrs: Fix a race condition in the ORR policy

Checking the atomic oo_ref in nrs_orr_hop_put_free() and then
taking the bucket lock leaves a race window open, by which a
second thread can attempt to free an already-freed
nrs_orr_object. Fix this, and change the hash bucket lock type
from an rwlock to a spinlock, as there are now as many calls on
the write path, as there are on the read path. Rehashing is not
used on the hashes, so libcfs_hash API usage can also be
simplified.

Lusrtr-commit: 548b8ea916625b3697b0e0d0abfc330b4c954633
Lustre-change: http://review.whamcloud.com/7623

Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Signed-off-by: Nikitas Angelinas <nikitas_angelinas@xyratex.com>
Xyratex-bug-id: MRP-1294
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-by: Emoly Liu <emoly.liu@intel.com>
Reviewed-by: Li Xi <pkuelelixi@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Change-Id: I08365b9888d781cb2bcbf871bf74d089bcf7ba9f
Reviewed-on: http://review.whamcloud.com/8162
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
lustre/include/lustre_net.h
lustre/ptlrpc/nrs_orr.c