From 94807aacbe488863ad2016f6abfdf404fe769bf8 Mon Sep 17 00:00:00 2001 From: Soumya Koduri Date: Wed, 28 Nov 2018 12:45:41 +0530 Subject: leases: Do not conflict with internal fops Internal fops (with frame->root->pid < 0) are used to heal or move data and maintains data integrity. That is they do not modify client data which holds the lease. Hence no need to recall Lease for such fops. Note: Like for locks, we would need rebalance and self-heal daemon process to heal lease state as well. Change-Id: I8988693fef8d00e17c19dcc842e2238f9eb5ab48 updates: bz#1655532 Signed-off-by: Soumya Koduri --- xlators/features/leases/src/leases-internal.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/xlators/features/leases/src/leases-internal.c b/xlators/features/leases/src/leases-internal.c index a4820ec481b..8695c9b2538 100644 --- a/xlators/features/leases/src/leases-internal.c +++ b/xlators/features/leases/src/leases-internal.c @@ -1079,6 +1079,17 @@ __check_lease_conflict (call_frame_t *frame, lease_inode_ctx_t *lease_ctx, goto recall; } + /* As internal fops are used to maintain data integrity but do not + * make modififications to the client data, no need to conflict with + * them. + * + * @todo: like for locks, even lease state has to be handled by + * rebalance or self-heal daemon process. */ + if (frame->root->pid < 0) { + conflicts = _gf_false; + goto recall; + } + /* If lease_id is not sent, set conflicts = true if there is * an existing lease */ if (!lease_id && (lease_ctx->lease_cnt > 0)) { -- cgit