Whamcloud - gitweb
LU-9504 ptlrpc: REP-ACK hr may race with trans commit 07/27207/9
authorLai Siyao <lai.siyao@intel.com>
Thu, 18 May 2017 16:27:31 +0000 (00:27 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 19 Jun 2017 16:27:40 +0000 (16:27 +0000)
commitca4659c9d1f010c1046b634cf5a592a620ac3935
treee014b373f8c1c9af91d2d6b0d82fe3495ea92176
parentfb9a8a991f5c9e8649053e86b3147a99aaee9f84
LU-9504 ptlrpc: REP-ACK hr may race with trans commit

REP-ACK hr may race with transaction commit, and the latter will
release saved locks, so in REP-ACK hr we need to get locks early to
convert them to COS mode safely.

But the locks got may be decrefed and canceled, in this case it
can't be converted to COS mode, remove an assert in
ldlm_lock_downgrade() for this.

Also protect mdt_steal_ack_locks() with rs_lock because it may also
race with REP-ACK hr. And move ldlm_lock_decref() outside of locks
because it may sleep.

Signed-off-by: Lai Siyao <lai.siyao@intel.com>
Change-Id: Ia9a3ba6a83689c0552ae8aaf2eb735c3f06b62e2
Reviewed-on: https://review.whamcloud.com/27207
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/ldlm/ldlm_lock.c
lustre/mdt/mdt_handler.c
lustre/mdt/mdt_recovery.c
lustre/ptlrpc/layout.c
lustre/ptlrpc/service.c