From fb6430906ae4fd9c7329944cd89dd4c493be1179 Mon Sep 17 00:00:00 2001 From: Lai Siyao Date: Sat, 23 Jun 2018 17:06:15 +0800 Subject: [PATCH] LU-11148 ldlm: enable trybits for PDO lock When trybits was added (in LU-9148), it doesn't enable trybits for PDO lock in mdt_object_local_lock(), which may cause deadlock in try_lock. Signed-off-by: Lai Siyao Change-Id: Icfca639cfbd84e1a3bc25d91de0460d2951c2c2b Reviewed-on: https://review.whamcloud.com/32820 Reviewed-by: Mike Pershin Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- lustre/mdt/mdt_handler.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index fb3f648..cd7448e 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -2891,8 +2891,13 @@ static int mdt_object_local_lock(struct mdt_thread_info *info, * is never going to be sent to client and we do not * want it slowed down due to possible cancels. */ - policy->l_inodebits.bits = MDS_INODELOCK_UPDATE; - policy->l_inodebits.try_bits = 0; + policy->l_inodebits.bits = + *ibits & MDS_INODELOCK_UPDATE; + policy->l_inodebits.try_bits = + trybits & MDS_INODELOCK_UPDATE; + /* at least one of them should be set */ + LASSERT(policy->l_inodebits.bits | + policy->l_inodebits.try_bits); rc = mdt_fid_lock(ns, &lh->mlh_pdo_lh, lh->mlh_pdo_mode, policy, res_id, dlmflags, info->mti_exp == NULL ? NULL : -- 1.8.3.1