summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-common.c
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-07-01 04:39:41 +0000
committerAnand Avati <avati@gluster.com>2011-07-14 01:01:33 -0700
commit6cf06cfd4bf72b16ac7665323629d354b78b6b05 (patch)
tree0162bec6d2c801f78c81a4af0b53e6fa23c61e46 /xlators/cluster/dht/src/dht-common.c
parent05a1422bbd82a28ccf7fa7c17b357f8350508e6e (diff)
cluster/distribute: handle layout overlaps while giving a new fix
Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2258 (enhance gluster volume rebalance) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2258
Diffstat (limited to 'xlators/cluster/dht/src/dht-common.c')
-rw-r--r--xlators/cluster/dht/src/dht-common.c32
1 files changed, 10 insertions, 22 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 4bc87fc2c43..237a0789426 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -2080,7 +2080,6 @@ dht_setxattr (call_frame_t *frame, xlator_t *this,
dht_layout_t *layout = NULL;
int i = 0;
int op_errno = EINVAL;
- int flag = 0;
int ret = -1;
data_t *tmp = NULL;
@@ -2115,29 +2114,18 @@ dht_setxattr (call_frame_t *frame, xlator_t *this,
tmp = dict_get (xattr, GF_XATTR_FIX_LAYOUT_KEY);
if (tmp) {
- for (i = 0; i < layout->cnt; i++) {
- if (layout->list[i].start == layout->list[i].stop) {
- flag = 1;
- break;
- }
- }
- if ((layout->cnt < conf->subvolume_cnt) || flag) {
- gf_log (this->name, GF_LOG_INFO,
- "expanding layout of %s from %d to %d",
- loc->path, layout->cnt, conf->subvolume_cnt);
-
- ret = loc_dup (loc, &local->loc);
- if (ret == -1) {
- op_errno = ENOMEM;
- goto err;
- }
+ gf_log (this->name, GF_LOG_INFO,
+ "fixing the layout of %s", loc->path);
- dht_selfheal_new_directory (frame, dht_fix_layout_cbk,
- layout);
- return 0;
+ ret = loc_dup (loc, &local->loc);
+ if (ret == -1) {
+ op_errno = ENOMEM;
+ goto err;
}
- op_errno = ENOTSUP;
- goto err;
+
+ dht_fix_directory_layout (frame, dht_fix_layout_cbk,
+ layout);
+ return 0;
}
local->call_cnt = layout->cnt;