From 523d23b94c21cf5cfdfd087409371d9d2dcf25a4 Mon Sep 17 00:00:00 2001 From: Vikas Gorur Date: Thu, 26 Feb 2009 17:13:25 +0530 Subject: Unset fd_ctx in afr_flush if it is set If fd_ctx is set, it means pending array needs to be decremented. However, flush might be called many times and it used to lead to multiple decrements. Fix is to unset fd_ctx on the first flush received Signed-off-by: Anand V. Avati --- xlators/cluster/afr/src/afr.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'xlators/cluster/afr') diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c index e4c1a847985..1be016a394b 100644 --- a/xlators/cluster/afr/src/afr.c +++ b/xlators/cluster/afr/src/afr.c @@ -833,6 +833,8 @@ afr_flush (call_frame_t *frame, xlator_t *this, fd_t *fd) frame->local = local; if (__is_fd_ctx_set (this, fd)) { + fd_ctx_del (fd, this, NULL); + local->op = GF_FOP_FLUSH; local->transaction.fop = afr_flush_wind; local->transaction.done = afr_flush_done; -- cgit