From 005d18a623dc49397e2a83a7fb80607ae0a9aed9 Mon Sep 17 00:00:00 2001 From: Poornima G Date: Tue, 17 May 2016 05:47:55 -0400 Subject: 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 Reviewed-on: http://review.gluster.org/14374 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Raghavendra Talur CentOS-regression: Gluster Build System --- xlators/features/leases/src/leases-internal.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'xlators/features/leases/src/leases-internal.c') 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; -- cgit