Whamcloud - gitweb
LU-5781 ldlm: Solve a race for LRU lock cancel 03/12603/8
authorVitaly Fertman <vitaly.fertman@seagate.com>
Wed, 3 Jun 2015 01:21:29 +0000 (04:21 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 11 Jun 2015 06:39:39 +0000 (06:39 +0000)
commit8ed3105b261fcc0816b064d6308356f645c9e12b
tree56684534d086fb4c20416f906e12c8a9b8c3fb88
parent42e72010c70a823d7ee04966a4a8a23c544ba2d7
LU-5781 ldlm: Solve a race for LRU lock cancel

This patch solves a race condition that the lock may be used again
after LRU cancellation policy check. In that case, the lock may have
locked or dirty pages that makes the policy check totally useless.
The problem is solved by checking l_last_used at cancellation time
therefore it can make sure that the lock has not been used.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Signed-off-by: Vitaly Fertman <vitaly_fertman@xyratex.com>
Change-Id: I3c7e2a3cc84fa9f549cf002e751018c022493606
Reviewed-on: http://review.whamcloud.com/12603
Tested-by: Jenkins
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/ldlm/ldlm_internal.h
lustre/ldlm/ldlm_lock.c
lustre/ldlm/ldlm_request.c