summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2017-05-24 03:17:33 -0400
committerRaghavendra G <rgowdapp@redhat.com>2017-05-25 04:21:04 +0000
commit90df37558d488f9a794f62ed74ec6d72879ed895 (patch)
tree2ee7f39e0e1b58b8cadc1c4655bc14dbe8c259b1 /xlators
parentb1fbc695a63801a3a2c62738fd6660388123724a (diff)
features/dht: Initialize local hashed_subvol
Self heal directory code path doesn't always have local->hashed_subvol populated. Populating the same which otherwise would fail the self heal. Change-Id: I03b64709fd7a68e28f9e7438243e817c53c6ef5d BUG: 1455104 Signed-off-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: https://review.gluster.org/17381 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: N Balachandran <nbalacha@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/dht/src/dht-selfheal.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c
index 1dd5823b0b5..1577d03e728 100644
--- a/xlators/cluster/dht/src/dht-selfheal.c
+++ b/xlators/cluster/dht/src/dht-selfheal.c
@@ -1501,8 +1501,10 @@ dht_selfheal_dir_mkdir (call_frame_t *frame, loc_t *loc,
int i = 0;
int ret = -1;
dht_local_t *local = NULL;
+ xlator_t *this = NULL;
local = frame->local;
+ this = frame->this;
local->selfheal.force_mkdir = force;
local->selfheal.hole_cnt = 0;
@@ -1518,6 +1520,19 @@ dht_selfheal_dir_mkdir (call_frame_t *frame, loc_t *loc,
return 0;
}
+ if (local->hashed_subvol == NULL)
+ local->hashed_subvol = dht_subvol_get_hashed (this, loc);
+
+ if (local->hashed_subvol == NULL) {
+ local->op_errno = EINVAL;
+ gf_msg (this->name, GF_LOG_WARNING, local->op_errno,
+ DHT_MSG_HASHED_SUBVOL_GET_FAILED,
+ "(%s/%s) (path: %s): "
+ "hashed subvolume not found", loc->pargfid, loc->name,
+ loc->path);
+ goto err;
+ }
+
local->current = &local->lock[0];
ret = dht_protect_namespace (frame, loc, local->hashed_subvol,
&local->current->ns,