summaryrefslogtreecommitdiffstats
path: root/xlators/features/leases
diff options
context:
space:
mode:
authorPoornima G <pgurusid@redhat.com>2016-05-17 05:47:55 -0400
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-05-19 02:28:03 -0700
commit005d18a623dc49397e2a83a7fb80607ae0a9aed9 (patch)
treedbac2574a003827e88f8cece358bb80b66a248e6 /xlators/features/leases
parent0660aa47b5ea782a5f7051544110cf0da73d598d (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. Change-Id: Id8ad542c649497f5e58f2acf5681c640d9202046 BUG: 1319992 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>
Diffstat (limited to 'xlators/features/leases')
-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;