Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1394400

[PATCH 2/9] staging: lustre: osc: Allow lock to be canceled at ENQ time

From James Simmons <jsimmons@infradead.org>
Newsgroups linux.kernel
Subject [PATCH 2/9] staging: lustre: osc: Allow lock to be canceled at ENQ time
Date 2016-05-04 16:50 +0200
Message-ID <rv6hJ-5S0-47@gated-at.bofh.it> (permalink)
References <rv5Ym-5ES-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Alexander Boyko <alexander_boyko@xyratex.com>

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: Jinshan Xiong <jinshan.xiong@intel.com>
Signed-off-by: Alexander 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: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lustre/include/obd_support.h | 1 +
 drivers/staging/lustre/lustre/osc/osc_request.c     | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/drivers/staging/lustre/lustre/include/obd_support.h b/drivers/staging/lustre/lustre/include/obd_support.h
index 1358af1..60034d3 100644
--- a/drivers/staging/lustre/lustre/include/obd_support.h
+++ b/drivers/staging/lustre/lustre/include/obd_support.h
@@ -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
diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c b/drivers/staging/lustre/lustre/osc/osc_request.c
index df06f4f..47417f8 100644
--- a/drivers/staging/lustre/lustre/osc/osc_request.c
+++ b/drivers/staging/lustre/lustre/osc/osc_request.c
@@ -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);
 
-- 
2.7.4

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/9] staging: lustre: bug fixes from the lustre 2.5.[54-55] release James Simmons <jsimmons@infradead.org> - 2016-05-04 16:50 +0200
  [PATCH 1/9] staging: lustre: nfs: don't panic NFS server if MDS fails to find FID James Simmons <jsimmons@infradead.org> - 2016-05-04 16:50 +0200
  [PATCH 2/9] staging: lustre: osc: Allow lock to be canceled at ENQ time James Simmons <jsimmons@infradead.org> - 2016-05-04 16:50 +0200
  [PATCH 6/9] staging: lustre: debug: clean up console messages James Simmons <jsimmons@infradead.org> - 2016-05-04 16:50 +0200
  [PATCH 4/9] staging: lustre: mdt: extra checking for getattr RPC. James Simmons <jsimmons@infradead.org> - 2016-05-04 16:50 +0200

csiph-web