From 6827f56dfcde4546e5adb3af65e7f21bef7fd58a Mon Sep 17 00:00:00 2001 From: Rajesh Amaravathi Date: Wed, 15 Feb 2012 14:33:19 +0530 Subject: protocol/client: delete locks only for non-anonymous fds delete_granted_lock_owners () is not called for anonymous fds since they are not involved in locking Change-Id: Icdc7818f98f5371232ba276ed442704ef69e6b0e BUG: 787365 Signed-off-by: Rajesh Amaravathi Reviewed-on: http://review.gluster.com/2754 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Vijay Bellur --- xlators/protocol/client/src/client-lk.c | 5 ++--- xlators/protocol/client/src/client3_1-fops.c | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/xlators/protocol/client/src/client-lk.c b/xlators/protocol/client/src/client-lk.c index 1bdde87df..842e3ec5b 100644 --- a/xlators/protocol/client/src/client-lk.c +++ b/xlators/protocol/client/src/client-lk.c @@ -375,9 +375,8 @@ delete_granted_locks_owner (fd_t *fd, gf_lkowner_t *owner) this = THIS; fdctx = this_fd_get_ctx (fd, this); if (!fdctx) { - if (!fd_is_anonymous (fd)) - gf_log (this->name, GF_LOG_WARNING, - "fdctx not valid"); + gf_log (this->name, GF_LOG_WARNING, + "fdctx not valid"); ret = -1; goto out; } diff --git a/xlators/protocol/client/src/client3_1-fops.c b/xlators/protocol/client/src/client3_1-fops.c index e3d6d36db..76d4fb0d6 100644 --- a/xlators/protocol/client/src/client3_1-fops.c +++ b/xlators/protocol/client/src/client3_1-fops.c @@ -723,7 +723,7 @@ client3_1_flush_cbk (struct rpc_req *req, struct iovec *iov, int count, goto out; } - if (rsp.op_ret >= 0) { + if (rsp.op_ret >= 0 && !fd_is_anonymous (local->fd)) { /* Delete all saved locks of the owner issuing flush */ ret = delete_granted_locks_owner (local->fd, &local->owner); gf_log (this->name, GF_LOG_TRACE, -- cgit