Whamcloud - gitweb
LU-5530 mdt: Properly match open lock and unlock
authorOleg Drokin <oleg.drokin@intel.com>
Mon, 29 Sep 2014 23:42:02 +0000 (19:42 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 7 Oct 2014 15:44:00 +0000 (11:44 -0400)
commitb4030258ea8c453fc88b541706acb51eb0e80485
tree4afe70a499f0ef6a6abe6df4cb9d962ee5063424
parent563745cbbd6f574c33d8b6a935b4b81715db6b3d
LU-5530 mdt: Properly match open lock and unlock

It seems that when request resend with a corresponding lock match is
in play (thanks to large striping + llnl patch for the client to send
small requests only), after all the suffering and fixing coming from
LU-2827, here is another casualty in in open/lease locking.
mdt_reint_open() and mdt_open_by_fid_lock() might match the lock
on resend and not call mdt_object_open_lock(), yet call
mdt_object_open_unlock() before exit.
Since mdt_object_open_lock/unlock also plays with a semaphore,
hilarity ensues usually most visible as a rw_sem lockup
in mdt_object_open_lock.

This patch adds tracking whenever we actually called mdt_object_open_lock
or not and only calls mdt_object_open_unlock if we did.

Change-Id: I73c529229acec98cac4ad73f7b487e759ad9a763
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/mdt/mdt_open.c