summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorVikas Gorur <vikas@zresearch.com>2009-02-26 17:13:25 +0530
committerAnand V. Avati <avati@amp.gluster.com>2009-02-26 18:03:12 +0530
commit523d23b94c21cf5cfdfd087409371d9d2dcf25a4 (patch)
tree25aa571ee25aa52c4ec3b9558a770e8742e5ec3a /xlators
parentb5377787903109dd5aea408e7b3a8e772b2be4f5 (diff)
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 <avati@amp.gluster.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/afr/src/afr.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c
index e4c1a8479..1be016a39 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;