Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 219eeac8 authored by Alexander Boyko's avatar Alexander Boyko Committed by Greg Kroah-Hartman
Browse files

staging: lustre: osc: Allow lock to be canceled at ENQ time



A cl_lock can be canceled when it's in CLS_ENQUEUED state.
We can't unuse this kind of lock in lov_lock_unuse() because
it will bring this lock into CLS_NEW state and then confuse
osc_lock_upcall().

Add a regression test case by Alexander Boyko.

Signed-off-by: default avatarJinshan Xiong <jinshan.xiong@intel.com>
Signed-off-by: default avatarAlexander Boyko <alexander_boyko@xyratex.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3889
Reviewed-on: http://review.whamcloud.com/8405


Reviewed-by: default avatarBobi Jam <bobijam@gmail.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1e5a6fa9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -321,6 +321,7 @@ extern char obd_jobid_var[];
#define OBD_FAIL_LDLM_AGL_DELAY	  0x31a
#define OBD_FAIL_LDLM_AGL_NOLOCK	 0x31b
#define OBD_FAIL_LDLM_OST_LVB		 0x31c
#define OBD_FAIL_LDLM_ENQUEUE_HANG	 0x31d

/* LOCKLESS IO */
#define OBD_FAIL_LDLM_SET_CONTENTION     0x385
+3 −0
Original line number Diff line number Diff line
@@ -2201,6 +2201,9 @@ static int osc_enqueue_interpret(const struct lu_env *env,
	 */
	ldlm_lock_addref(lockh, mode);

	/* Let cl_lock_state_wait fail with -ERESTARTSYS to unuse sublocks. */
	OBD_FAIL_TIMEOUT(OBD_FAIL_LDLM_ENQUEUE_HANG, 2);

	/* Let CP AST to grant the lock first. */
	OBD_FAIL_TIMEOUT(OBD_FAIL_OSC_CP_ENQ_RACE, 1);