Whamcloud - gitweb
LU-6416 ldlm: no canceled lock on waiting list 85/14085/5
authorLiang Zhen <liang.zhen@intel.com>
Mon, 16 Mar 2015 01:25:17 +0000 (09:25 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 31 Mar 2015 19:41:39 +0000 (19:41 +0000)
commit657bbc4969be581aca66549ca0427ccec89ea5a2
tree707a00dcf8cb3ad184aee4d4516a5f17a3fe1f54
parentea9c6739315e7667228add03ff59b38bbf38f959
LU-6416 ldlm: no canceled lock on waiting list

If a lock was not granted straight away on server, but it's granted
with LDLM_FL_AST_SENT set before ldlm_handle_enqueue0 sends out
reply, client side will know she needs to cancel this lock.

At the meanwhile, this lock can be added to a long granting list
by another server thread.

When lock cancel request arrives at server and server calls into
  ldlm_lock_cancel()->
      ldlm_cancel_callback()->
          tgt_blocking_ast(...LDLM_CB_CANCELING)->
              tgt_sync()

The other server thread eventually get a chance to send completion
AST for this lock with LDLM_FL_AST_SENT set, and add this lock to
waiting list again.

However, tgt_sync may take arbitrary time which is irrelevant
to AT of lock revoke on client, server could evict client only
because itself has slow IO.

To resolve this race, this patch does not put canceled lock on
waiting list anymore.

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Change-Id: I86c1097d3ccbaa614b8811c1d9f37b39f019c61e
Reviewed-on: http://review.whamcloud.com/14085
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Tested-by: Jenkins
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/ldlm/ldlm_lock.c
lustre/ldlm/ldlm_lockd.c