From 6a2c2fa4f13f9ed96098c4fec40f747e171e6819 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Tue, 12 Apr 2011 05:00:18 +0000 Subject: protocol/client: fix the fd_count decrement logic the error creeped in during some code cleanup and logging enhancement Signed-off-by: Amar Tumballi Signed-off-by: Anand Avati BUG: 1761 (incorrect self-heal behaviour when files are deleted) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1761 --- xlators/protocol/client/src/client-handshake.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'xlators/protocol/client/src/client-handshake.c') diff --git a/xlators/protocol/client/src/client-handshake.c b/xlators/protocol/client/src/client-handshake.c index 418307c41..1ba128b94 100644 --- a/xlators/protocol/client/src/client-handshake.c +++ b/xlators/protocol/client/src/client-handshake.c @@ -459,6 +459,8 @@ client3_1_reopen_cbk (struct rpc_req *req, struct iovec *iov, int count, } pthread_mutex_unlock (&conf->lock); + ret = 0; + attempt_lock_recovery = _gf_false; /* temporarily */ if (attempt_lock_recovery) { @@ -471,11 +473,10 @@ client3_1_reopen_cbk (struct rpc_req *req, struct iovec *iov, int count, "need to attempt lock recovery on %"PRIu64 " open fds", fd_count); } + } else { + fd_count = decrement_reopen_fd_count (frame->this, conf); } - out: - if (!attempt_lock_recovery) - fd_count = decrement_reopen_fd_count (frame->this, conf); if (fdctx) client_fdctx_destroy (frame->this, fdctx); @@ -558,6 +559,7 @@ client3_1_reopendir_cbk (struct rpc_req *req, struct iovec *iov, int count, } pthread_mutex_unlock (&conf->lock); + decrement_reopen_fd_count (frame->this, conf); ret = 0; out: -- cgit