Whamcloud - gitweb
LU-6939 nrs: add lock to protect TBF rule linkage 96/17596/3
authorLi Xi <lixi@ddn.com>
Thu, 3 Dec 2015 02:49:03 +0000 (10:49 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 25 Jan 2016 01:58:13 +0000 (01:58 +0000)
commit839360d35e27087e8266b02c5dd69e5e940577c5
treeb4b2c8f76193cd19d1055692a937e2563bb369d2
parent6c61075bcf2f310a83a8d4c9173c9b9f4370f5ac
LU-6939 nrs: add lock to protect TBF rule linkage

Due to lack of lock protection for operations on rule's list of
client (nrs_tbf_rule->tr_cli_list), it leads to assertion panic
"ASSERTION( cli->tc_rule == ((void *)0) ) failed". Add spinlock
to control concurrent access to the list of client for a rule to
avoid this assertion failure.

Also, some of the fields of rule is inited earlier in
nrs_tbf_rule_start() so as to prevent crash in nrs_tbf_rule_put().

Signed-off-by: Li Xi <lixi@ddn.com>
Change-Id: Ic9ecb4318329400ac0f5900d185c60d4b9a98c48
Reviewed-on: http://review.whamcloud.com/17596
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Henri Doreau <henri.doreau@cea.fr>
Reviewed-by: Nikitas Angelinas <nikitasangelinas@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/lustre_nrs_tbf.h
lustre/ptlrpc/nrs_tbf.c