mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: James Simmons <jsimmons@infradead.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	devel@driverdev.osuosl.org,
	Andreas Dilger <andreas.dilger@intel.com>,
	Oleg Drokin <oleg.drokin@intel.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Lustre Development List <lustre-devel@lists.lustre.org>,
	Alexander Boyko <alexander_boyko@xyratex.com>,
	Jinshan Xiong <jinshan.xiong@intel.com>,
	James Simmons <jsimmons@infradead.org>
Subject: [PATCH 2/9] staging: lustre: osc: Allow lock to be canceled at ENQ time
Date: Wed,  4 May 2016 10:28:53 -0400	[thread overview]
Message-ID: <1462372140-27880-3-git-send-email-jsimmons@infradead.org> (raw)
In-Reply-To: <1462372140-27880-1-git-send-email-jsimmons@infradead.org>

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

  parent reply	other threads:[~2016-05-04 14:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-04 14:28 [PATCH 0/9] staging: lustre: bug fixes from the lustre 2.5.[54-55] release James Simmons
2016-05-04 14:28 ` [PATCH 1/9] staging: lustre: nfs: don't panic NFS server if MDS fails to find FID James Simmons
2016-05-04 14:28 ` James Simmons [this message]
2016-05-04 14:28 ` [PATCH 3/9] staging: lustre: lov: remove lov and lod stuff from obd.h James Simmons
2016-05-04 14:28 ` [PATCH 4/9] staging: lustre: mdt: extra checking for getattr RPC James Simmons
2016-05-04 14:28 ` [PATCH 5/9] staging: lustre: fid: packing ost_idx in IDIF James Simmons
2016-05-10 13:20   ` Dan Carpenter
2016-05-04 14:28 ` [PATCH 6/9] staging: lustre: debug: clean up console messages James Simmons
2016-05-04 14:28 ` [PATCH 7/9] staging: lustre: ptlrpc: fix nrs cleanup James Simmons
2016-05-04 14:28 ` [PATCH 8/9] staging: lustre: fid: init FID client for OSP on MDT James Simmons
2016-05-04 14:29 ` [PATCH 9/9] staging: lustre: lov: remove unused lov obd functions James Simmons

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1462372140-27880-3-git-send-email-jsimmons@infradead.org \
    --to=jsimmons@infradead.org \
    --cc=alexander_boyko@xyratex.com \
    --cc=andreas.dilger@intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jinshan.xiong@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lustre-devel@lists.lustre.org \
    --cc=oleg.drokin@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®