summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPoornima G <pgurusid@redhat.com>2016-05-17 05:47:55 -0400
committerRaghavendra Talur <rtalur@redhat.com>2016-05-20 03:57:00 -0700
commit6dfb357d69376574c600d65555e0b6c45bc464f8 (patch)
tree0150db6319e0b13dfcd4ad0c8ed804a324c487b6
parentb82fefed59cd3964c4d667b1645e70825be8e984 (diff)
leases: Fix failure of RD_lease request in certain scenario
Issue: When RW_lease exists for a given lease id and another request for RD_lease comes in with the same lease id, it gets rejected. Fix: Allow the RD_lease when RW_lease is present iff its from the same lease id. Backport of http://review.gluster.org/#/c/14374/ Change-Id: Id8ad542c649497f5e58f2acf5681c640d9202046 BUG: 1337638 Signed-off-by: Poornima G <pgurusid@redhat.com> Reviewed-on: http://review.gluster.org/14374 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra Talur <rtalur@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> (cherry picked from commit 005d18a623dc49397e2a83a7fb80607ae0a9aed9) Reviewed-on: http://review.gluster.org/14430
-rw-r--r--xlators/features/leases/src/leases-internal.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/xlators/features/leases/src/leases-internal.c b/xlators/features/leases/src/leases-internal.c
index 8ed0abcae82..a52bf577b75 100644
--- a/xlators/features/leases/src/leases-internal.c
+++ b/xlators/features/leases/src/leases-internal.c
@@ -747,7 +747,9 @@ __is_lease_grantable (xlator_t *this, lease_inode_ctx_t *lease_ctx,
}
/* check for conflict with existing leases */
- if (lease_ctx->lease_type == NONE || lease_ctx->lease_type == GF_RD_LEASE)
+ if (lease_ctx->lease_type == NONE ||
+ lease_ctx->lease_type == GF_RD_LEASE ||
+ !(__another_lease_found (lease_ctx, lease->lease_id)))
grant = _gf_true;
else
grant = _gf_false;