summaryrefslogtreecommitdiffstats
path: root/xlators/features/locks/src/common.c
diff options
context:
space:
mode:
authorSusant Palai <spalai@redhat.com>2019-07-22 15:20:43 +0530
committerAmar Tumballi <amarts@redhat.com>2019-08-02 14:26:40 +0000
commitd072dc09f5bc6431ba31244cf7e9eba1b6e85229 (patch)
treeb7f0c4f10bf353d6c497ccafa18cc3600b5bf86c /xlators/features/locks/src/common.c
parent84f7794547522463841068063b22fd3a8d8fca2b (diff)
locks/fencing: Address hang while lock preemption
The fop_wind_count can go negative when fencing is enabled on unwind path of the IO leading to hang. Also changed code so that fop_wind_count needs to be maintained only till fencing is enabled on the file. updates: bz#1717824 Change-Id: Icd04b42bc16cd3d50eaa581ee57233910194f480 Signed-off-by: Susant Palai <spalai@redhat.com>
Diffstat (limited to 'xlators/features/locks/src/common.c')
-rw-r--r--xlators/features/locks/src/common.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/xlators/features/locks/src/common.c b/xlators/features/locks/src/common.c
index 429ce32803e..4b895256c29 100644
--- a/xlators/features/locks/src/common.c
+++ b/xlators/features/locks/src/common.c
@@ -1189,13 +1189,6 @@ pl_lock_preempt(pl_inode_t *pl_inode, posix_lock_t *reqlock)
list_del_init(&rw->list);
list_add(&rw->list, &unwind_rw_list);
}
-
- while (pl_inode->fop_wind_count != 0) {
- gf_msg(THIS->name, GF_LOG_TRACE, 0, 0,
- "waiting for fops to be drained");
- pthread_cond_wait(&pl_inode->check_fop_wind_count,
- &pl_inode->mutex);
- }
}
pthread_mutex_unlock(&pl_inode->mutex);