Whamcloud - gitweb
LU-3430 nrs: Fix a race condition in the ORR policy 23/7623/3
authorNikitas Angelinas <nikitas_angelinas@xyratex.com>
Wed, 11 Sep 2013 22:43:23 +0000 (23:43 +0100)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 23 Sep 2013 16:42:25 +0000 (16:42 +0000)
commit548b8ea916625b3697b0e0d0abfc330b4c954633
treed184711a637249f8488d15e8565303342b70d90b
parentac72455c4d8b02c0661dfca7de29b184960fe53c
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.

Signed-off-by: Nikitas Angelinas <nikitas_angelinas@xyratex.com>
Change-Id: I2e16320c5e4b0803e1bef428f26ea18b0341ac5f
Xyratex-bug-id: MRP-1294
Reviewed-on: http://review.whamcloud.com/7623
Tested-by: Maloo <whamcloud.maloo@gmail.com>
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>
lustre/include/lustre_net.h
lustre/ptlrpc/nrs_orr.c