summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2016-06-11 18:43:42 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-07-29 18:04:22 -0700
commit4a49d3116b00811b7a4ba98f51bb27da0fa63d5c (patch)
tree85efe0a2eb3e033ee8ec55d7b3f3bf8018cc25c1 /xlators
parentaa2c33c8104e4870b66f7c5ed52ca7f3daff30a2 (diff)
cluster/ec: Unlock stale locks when inodelk/entrylk/lk fails
Thanks to Rafi for hinting a while back that this kind of problem he saw once. I didn't think the theory was valid. Could have caught it earlier if I had tested his theory. >Change-Id: Iac6ffcdba2950aa6f8cf94f8994adeed6e6a9c9b >BUG: 1344836 >Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> >Reviewed-on: http://review.gluster.org/14703 >Reviewed-by: Xavier Hernandez <xhernandez@datalab.es> >Smoke: Gluster Build System <jenkins@build.gluster.org> >Tested-by: mohammed rafi kc <rkavunga@redhat.com> >NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> >CentOS-regression: Gluster Build System <jenkins@build.gluster.org> BUG: 1361402 Change-Id: If9ccf0b3db7159b87ddcdc7b20e81cde8c3c76f0 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/15040 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Xavier Hernandez <xhernandez@datalab.es> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/ec/src/ec-locks.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/xlators/cluster/ec/src/ec-locks.c b/xlators/cluster/ec/src/ec-locks.c
index 7902a99..0253b51 100644
--- a/xlators/cluster/ec/src/ec-locks.c
+++ b/xlators/cluster/ec/src/ec-locks.c
@@ -197,10 +197,11 @@ int32_t ec_manager_entrylk(ec_fop_data_t * fop, int32_t state)
return EC_STATE_PREPARE_ANSWER;
case EC_STATE_PREPARE_ANSWER:
+ case -EC_STATE_PREPARE_ANSWER:
if (fop->entrylk_cmd != ENTRYLK_UNLOCK) {
uintptr_t mask;
- fop->error = ec_lock_check(fop, &mask);
+ ec_fop_set_error (fop, ec_lock_check(fop, &mask));
if (fop->error != 0) {
if (mask != 0) {
if (fop->id == GF_FOP_ENTRYLK) {
@@ -258,7 +259,6 @@ int32_t ec_manager_entrylk(ec_fop_data_t * fop, int32_t state)
case -EC_STATE_INIT:
case -EC_STATE_DISPATCH:
- case -EC_STATE_PREPARE_ANSWER:
case -EC_STATE_REPORT:
GF_ASSERT(fop->error != 0);
@@ -590,10 +590,11 @@ int32_t ec_manager_inodelk(ec_fop_data_t * fop, int32_t state)
return EC_STATE_PREPARE_ANSWER;
case EC_STATE_PREPARE_ANSWER:
+ case -EC_STATE_PREPARE_ANSWER:
if (fop->flock.l_type != F_UNLCK) {
uintptr_t mask;
- fop->error = ec_lock_check(fop, &mask);
+ ec_fop_set_error (fop, ec_lock_check(fop, &mask));
if (fop->error != 0) {
if (mask != 0) {
ec_t *ec = fop->xl->private;
@@ -659,7 +660,6 @@ int32_t ec_manager_inodelk(ec_fop_data_t * fop, int32_t state)
case -EC_STATE_INIT:
case -EC_STATE_DISPATCH:
- case -EC_STATE_PREPARE_ANSWER:
case -EC_STATE_REPORT:
GF_ASSERT(fop->error != 0);
@@ -1026,10 +1026,11 @@ int32_t ec_manager_lk(ec_fop_data_t * fop, int32_t state)
return EC_STATE_PREPARE_ANSWER;
case EC_STATE_PREPARE_ANSWER:
+ case -EC_STATE_PREPARE_ANSWER:
if (fop->flock.l_type != F_UNLCK) {
uintptr_t mask;
- fop->error = ec_lock_check(fop, &mask);
+ ec_fop_set_error (fop, ec_lock_check(fop, &mask));
if (fop->error != 0) {
if (mask != 0) {
ec_t *ec = fop->xl->private;
@@ -1077,7 +1078,6 @@ int32_t ec_manager_lk(ec_fop_data_t * fop, int32_t state)
case -EC_STATE_INIT:
case -EC_STATE_DISPATCH:
- case -EC_STATE_PREPARE_ANSWER:
case -EC_STATE_REPORT:
GF_ASSERT(fop->error != 0);