summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
diff options
context:
space:
mode:
authorVikas Gorur <vikas@gluster.com>2009-09-03 09:44:34 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-09-08 04:47:37 -0700
commit1eb3fd72b13353fdb93dd0773d9da7aafccdde6b (patch)
tree8a0570dc8e6829e5826bfc7b9a0617cc34b8d5f5 /xlators/cluster
parent5ce1007f3b9a5234caa5b8a8c168c6b673d37f7e (diff)
cluster/afr: Do not try to self-heal "/"
If the root directory does not exist on a subvolume, don't try to create it. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 28 (Deleting a backend export directory in an AFR setup can cause a segfault while trying to self heal) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=28
Diffstat (limited to 'xlators/cluster')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-common.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c
index 99e6503ac3a..38fe1e6e7f3 100644
--- a/xlators/cluster/afr/src/afr-self-heal-common.c
+++ b/xlators/cluster/afr/src/afr-self-heal-common.c
@@ -980,14 +980,22 @@ sh_missing_entries_mkdir (call_frame_t *frame, xlator_t *this)
for (i = 0; i < priv->child_count; i++) {
if (sh->child_errno[i] == ENOENT) {
- STACK_WIND_COOKIE (frame,
- sh_missing_entries_newentry_cbk,
- (void *) (long) i,
- priv->children[i],
- priv->children[i]->fops->mkdir,
- &local->loc, st_mode);
- if (!--call_count)
- break;
+ if (!strcmp (local->loc.path, "/")) {
+ /* We shouldn't try to create "/" */
+
+ sh_missing_entries_finish (frame, this);
+
+ return 0;
+ } else {
+ STACK_WIND_COOKIE (frame,
+ sh_missing_entries_newentry_cbk,
+ (void *) (long) i,
+ priv->children[i],
+ priv->children[i]->fops->mkdir,
+ &local->loc, st_mode);
+ if (!--call_count)
+ break;
+ }
}
}