diff options
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/features/leases/src/leases-internal.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/xlators/features/leases/src/leases-internal.c b/xlators/features/leases/src/leases-internal.c index 475576eac79..51cfbaeeec4 100644 --- a/xlators/features/leases/src/leases-internal.c +++ b/xlators/features/leases/src/leases-internal.c @@ -992,7 +992,7 @@ process_lease_req (call_frame_t *frame, xlator_t *this, case GF_UNLK_LEASE: ret = __remove_lease (this, inode, lease_ctx, client_uid, lease); - if ((ret == 0) && (lease_ctx->lease_cnt == 0)) { + if ((ret >= 0) && (lease_ctx->lease_cnt == 0)) { pthread_mutex_unlock (&lease_ctx->lock); goto unblock; } @@ -1039,9 +1039,13 @@ __check_lease_conflict (call_frame_t *frame, lease_inode_ctx_t *lease_ctx, goto recall; } - /* TODO: If lease_id is not sent, fall back to client uid conflict check? - * Or set conflicts = true if lease_id is 0 when there is an existing - * lease */ + /* If lease_id is not sent, set conflicts = true if there is + * an existing lease */ + if (!lease_id && (lease_ctx->lease_cnt > 0)) { + conflicts = _gf_true; + goto recall; + } + switch (lease_type) { case (GF_RW_LEASE | GF_RD_LEASE): case GF_RW_LEASE: |