[057/622] lustre: ldlm: don't add canceling lock back to LRU
diff mbox series

Message ID 1582838290-17243-58-git-send-email-jsimmons@infradead.org
State New
Headers show
Series
  • lustre: sync closely to 2.13.52
Related show

Commit Message

James Simmons Feb. 27, 2020, 9:08 p.m. UTC
From: Mikhail Pershin <mpershin@whamcloud.com>

When lock is converted check it is not canceling before
adding it back to LRU.

Lustre-commit: ad52f394bd82 ("LU-11003 ldlm: don't add canceling lock back to LRU")
Signed-off-by: Mikhail Pershin <mpershin@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/32692
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/ldlm/ldlm_request.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/fs/lustre/ldlm/ldlm_request.c b/fs/lustre/ldlm/ldlm_request.c
index ad54bd2..bc441f0 100644
--- a/fs/lustre/ldlm/ldlm_request.c
+++ b/fs/lustre/ldlm/ldlm_request.c
@@ -893,7 +893,8 @@  static int lock_convert_interpret(const struct lu_env *env,
 			 * is not there yet.
 			 */
 			lock->l_policy_data.l_inodebits.cancel_bits = 0;
-			if (!lock->l_readers && !lock->l_writers) {
+			if (!lock->l_readers && !lock->l_writers &&
+			    !ldlm_is_canceling(lock)) {
 				spin_lock(&ns->ns_lock);
 				/* there is check for list_empty() inside */
 				ldlm_lock_remove_from_lru_nolock(lock);