diff options
author | Pavan Sondur <pavan@gluster.com> | 2010-09-06 09:01:24 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-09-06 09:38:18 -0700 |
commit | d38b2217393c460937505f30bd61576e7957f877 (patch) | |
tree | f3d69e93d6c8337146c7ba0fabc40ec44204c2a7 /xlators/cluster/afr/src/afr-lk-common.c | |
parent | 716776f2e35d240db7b9731a4eda557a0be462f8 (diff) |
cluster/afr: Fix hang in create when one subvol is down.
Signed-off-by: Pavan Vilas Sondur <pavan@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 1544 (Create fails when 1 server is down)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1544
Diffstat (limited to 'xlators/cluster/afr/src/afr-lk-common.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-lk-common.c | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/xlators/cluster/afr/src/afr-lk-common.c b/xlators/cluster/afr/src/afr-lk-common.c index 50f253e8cdf..749c6bf9a59 100644 --- a/xlators/cluster/afr/src/afr-lk-common.c +++ b/xlators/cluster/afr/src/afr-lk-common.c @@ -615,6 +615,10 @@ afr_unlock_inodelk (call_frame_t *frame, xlator_t *this) priv->children[i]->fops->finodelk, this->name, local->fd, F_SETLK, &flock); + + if (!--call_count) + break; + } else { afr_trace_inodelk_in (frame, AFR_INODELK_TRANSACTION, AFR_UNLOCK_OP, &flock, F_SETLK, i); @@ -625,12 +629,14 @@ afr_unlock_inodelk (call_frame_t *frame, xlator_t *this) priv->children[i]->fops->inodelk, this->name, &local->loc, F_SETLK, &flock); + + if (!--call_count) + break; + } } - if (!--call_count) - break; } out: @@ -693,10 +699,10 @@ afr_unlock_entrylk (call_frame_t *frame, xlator_t *this) this->name, loc, basename, ENTRYLK_UNLOCK, ENTRYLK_WRLCK); - } - if (!--call_count) - break; + if (!--call_count) + break; + } } out: @@ -1267,10 +1273,11 @@ afr_nonblocking_entrylk (call_frame_t *frame, xlator_t *this) priv->children[i]->fops->entrylk, this->name, loc, basename, ENTRYLK_LOCK, ENTRYLK_WRLCK); - } - if (!--call_count) - break; + if (!--call_count) + break; + + } } } @@ -1405,10 +1412,10 @@ afr_nonblocking_inodelk (call_frame_t *frame, xlator_t *this) this->name, local->fd, F_SETLK, &flock); - } + if (!--call_count) + break; - if (!--call_count) - break; + } } } else { @@ -1426,10 +1433,11 @@ afr_nonblocking_inodelk (call_frame_t *frame, xlator_t *this) priv->children[i]->fops->inodelk, this->name, &local->loc, F_SETLK, &flock); - } - if (!--call_count) - break; + if (!--call_count) + break; + + } } } @@ -1525,10 +1533,11 @@ afr_unlock_lower_entrylk (call_frame_t *frame, xlator_t *this) this->name, loc, basename, ENTRYLK_UNLOCK, ENTRYLK_WRLCK); - } - if (!--call_count) - break; + if (!--call_count) + break; + + } } out: |