summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSoumya Koduri <skoduri@redhat.com>2018-11-28 12:45:41 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2018-12-12 12:54:48 +0000
commit2438964129d37a6ec62006916ff4e454f6b034b9 (patch)
tree62c11ca512803dc6dda8e27ff8a0968ae7f5d1f6
parentb75d7a540509a4fd9ead6fb74e525a8ba31dfc7c (diff)
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#1651323 Signed-off-by: Soumya Koduri <skoduri@redhat.com> (cherry picked from commit 080aa5b9e9d998552e23f7c33aed3afb0ca93c34)
-rw-r--r--xlators/features/leases/src/leases-internal.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/xlators/features/leases/src/leases-internal.c b/xlators/features/leases/src/leases-internal.c
index 2823ca5a262..ba0db4f9b4a 100644
--- a/xlators/features/leases/src/leases-internal.c
+++ b/xlators/features/leases/src/leases-internal.c
@@ -1068,6 +1068,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)) {