summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr.c
diff options
context:
space:
mode:
authorVikas Gorur <vikas@gluster.com>2009-11-25 07:51:23 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-11-25 06:03:39 -0800
commit1bcb009cf65e57117653bbbb5cdf673f9d9142e9 (patch)
treec9e4d4b7f29c1c6498e7b0ae3b010f710ffc081d /xlators/cluster/afr/src/afr.c
parent9806bd1f58d80d158e3cfb6edee40e92ee30c6d7 (diff)
cluster/afr: Do self-heal on unopened fds.
This patch completes the previous patch for self-heal of open fds in replicate. If an fd was never opened on a subvolume, we remember that and do the open after we've done self-heal on that fd. Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 170 (Auto-heal fails on files that are open()-ed/mmap()-ed) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=170
Diffstat (limited to 'xlators/cluster/afr/src/afr.c')
-rw-r--r--xlators/cluster/afr/src/afr.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c
index 994588c87f0..2d0138aba68 100644
--- a/xlators/cluster/afr/src/afr.c
+++ b/xlators/cluster/afr/src/afr.c
@@ -856,6 +856,15 @@ afr_fd_ctx_set (xlator_t *this, fd_t *fd)
goto unlock;
}
+ fd_ctx->opened_on = CALLOC (sizeof (*fd_ctx->opened_on),
+ priv->child_count);
+ if (!fd_ctx->opened_on) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "Out of memory");
+ op_ret = -ENOMEM;
+ goto unlock;
+ }
+
fd_ctx->child_failed = CALLOC (sizeof (*fd_ctx->child_failed),
priv->child_count);