diff options
author | Pavan Sondur <pavan@gluster.com> | 2010-10-21 06:56:06 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-10-21 10:00:39 -0700 |
commit | 5cbc81a8d32434ff0c3e104ec802bcdc8c582f20 (patch) | |
tree | da463650cb6bf10ff711b138dc373005a0b0f90d /xlators/features/locks/src/common.c | |
parent | ef4005be3ac7f0f266f139c5b3d66538e35b924c (diff) |
cluster/afr: Do a broadcast unlock in replicate to eliminate deadlock during upgrade/downgrade.v3.0.6rc2v3.0.6
Signed-off-by: Pavan Vilas Sondur <pavan@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 1017 (Locking deadlock when upgrading lock)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1017
Diffstat (limited to 'xlators/features/locks/src/common.c')
-rw-r--r-- | xlators/features/locks/src/common.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/xlators/features/locks/src/common.c b/xlators/features/locks/src/common.c index 483d7bf57fc..9b712bb32bb 100644 --- a/xlators/features/locks/src/common.c +++ b/xlators/features/locks/src/common.c @@ -923,17 +923,17 @@ pl_setlk (xlator_t *this, pl_inode_t *pl_inode, posix_lock_t *lock, pthread_mutex_lock (&pl_inode->mutex); { - /* Send unlock before the actual lock to - prevent lock upgrade / downgrade - problems + /* Send unlock before the actual blocking lock + to support lock upgrades / downgrades. */ - - ret = pl_send_prelock_unlock (this, pl_inode, - lock); - if (ret) - gf_log (this->name, GF_LOG_DEBUG, - "Could not send pre-lock " - "unlock"); + if (can_block) { + ret = pl_send_prelock_unlock (this, pl_inode, + lock); + if (ret) + gf_log (this->name, GF_LOG_DEBUG, + "Could not send pre-lock " + "unlock"); + } if (__is_lock_grantable (pl_inode, lock)) { gf_log (this->name, GF_LOG_TRACE, |