diff options
| author | Kotresh HR <khiremat@redhat.com> | 2017-05-24 03:17:33 -0400 | 
|---|---|---|
| committer | Shyamsundar Ranganathan <srangana@redhat.com> | 2017-05-25 13:07:01 +0000 | 
| commit | bf335dd1fbb67e852bf974fc42a270d772fb6bb9 (patch) | |
| tree | f63ac5a5e4d7642e9f6dc1bff45767f21a2f4507 | |
| parent | 82a6a6a401fabd427491c7b7c71257dd44edb61c (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>
(cherry picked from commit 90df37558d488f9a794f62ed74ec6d72879ed895)
Change-Id: I03b64709fd7a68e28f9e7438243e817c53c6ef5d
BUG: 1455423
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Reviewed-on: https://review.gluster.org/17388
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
| -rw-r--r-- | xlators/cluster/dht/src/dht-selfheal.c | 15 | 
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,  | 
