diff options
author | Poornima G <pgurusid@redhat.com> | 2016-05-19 05:04:13 -0400 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2016-06-01 00:33:08 -0700 |
commit | b06a77f3446d622f8159f08508f4d5063ec50339 (patch) | |
tree | afbb15743ba9ebb3e2381cfeb71ab5321fea2215 /xlators/features/leases/src/leases-internal.c | |
parent | e341d2827800e32997f888668597785178a40626 (diff) |
leases: Fix the recall code path
1. Replace frame->op usage with frame->root->op, as frame->op
is not filled with appropriate value in all cases
2. Add few log messages
3. Fix boolean assignment
Change-Id: I340f2200c1fcc4f4ce5a139b0fd22508cb8ac1e3
BUG: 1319992
Signed-off-by: Poornima G <pgurusid@redhat.com>
Reviewed-on: http://review.gluster.org/14434
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>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/features/leases/src/leases-internal.c')
-rw-r--r-- | xlators/features/leases/src/leases-internal.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/xlators/features/leases/src/leases-internal.c b/xlators/features/leases/src/leases-internal.c index 24e8389cbc6..6884b581273 100644 --- a/xlators/features/leases/src/leases-internal.c +++ b/xlators/features/leases/src/leases-internal.c @@ -1033,7 +1033,8 @@ __check_lease_conflict (call_frame_t *frame, lease_inode_ctx_t *lease_ctx, /* If the fop is rename or unlink conflict the lease even if its * from the same client?? */ - if ((frame->op == GF_FOP_RENAME) || (frame->op == GF_FOP_UNLINK)) { + if ((frame->root->op == GF_FOP_RENAME) || + (frame->root->op == GF_FOP_UNLINK)) { conflicts = _gf_true; goto recall; } @@ -1096,15 +1097,15 @@ check_lease_conflict (call_frame_t *frame, inode_t *inode, goto out; } - is_blocking_fop = fop_flags & BLOCKING_FOP; - is_write_fop = fop_flags & DATA_MODIFY_FOP; + is_blocking_fop = ((fop_flags & BLOCKING_FOP) != 0); + is_write_fop = ((fop_flags & DATA_MODIFY_FOP) != 0); pthread_mutex_lock (&lease_ctx->lock); { if (lease_ctx->lease_type == NONE) { gf_msg_debug (frame->this->name, 0, - "No leases found continuing with the" - " fop:%s", gf_fop_list[frame->op]); + "No leases found continuing with the" + " fop:%s", gf_fop_list[frame->root->op]); ret = WIND_FOP; goto unlock; } @@ -1115,14 +1116,15 @@ check_lease_conflict (call_frame_t *frame, inode_t *inode, gf_msg_debug (frame->this->name, 0, "Fop: %s " "conflicting existing " "lease: %d, blocking the" - "fop", gf_fop_list[frame->op], + "fop", gf_fop_list[frame->root->op], lease_ctx->lease_type); ret = BLOCK_FOP; } else { gf_msg_debug (frame->this->name, 0, "Fop: %s " "conflicting existing " "lease: %d, sending " - "EAGAIN", gf_fop_list[frame->op], + "EAGAIN", + gf_fop_list[frame->root->op], lease_ctx->lease_type); errno = EAGAIN; ret = -1; |