summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
diff options
context:
space:
mode:
authorVenkatesh Somyajulu <vsomyaju@redhat.com>2014-09-22 13:29:13 +0530
committerVijay Bellur <vbellur@redhat.com>2014-09-22 22:50:28 -0700
commitf14d9bdd52b428466e7863d06c89b4684be3da07 (patch)
treeebcb0cbec80ffe78c19fcb3a7f818b7f1441d19c /xlators/cluster
parentde713588b81acc912b33b00474ea3cfa6620ceb1 (diff)
cluster/dht: Modified the calculation of brick_count
Whenever new_layout is calculated for a directory, we calculate the number of childs of dht, who will get the actual(Non-zero) layout-range, and assign range to only those subvolume and other will get 0 as their layout->start and layout->stop value. This calculation is based on either a) weight_by_size or b) number of brick who will be assigned the non-zero range So if in case we are not assigning the layout based on weight_by_size, we should choose the "bricks_to_use" instead of "bricks_used". In regression test, we found that priv->du_stat[0].chunks was zero. In this case "bricks_used" variable will be zero, which will cause crash for chunk = ((unsigned long) 0xffffffff) / bricks__used; calculation. Change-Id: I6f1b21eff972a80d9eb22771087c1e2f53e7e724 BUG: 1143835 Signed-off-by: Venkatesh Somyajulu <vsomyaju@redhat.com> Reviewed-on: http://review.gluster.org/8792 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'xlators/cluster')
-rw-r--r--xlators/cluster/dht/src/dht-selfheal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c
index a92dba89d2b..2d12abe9747 100644
--- a/xlators/cluster/dht/src/dht-selfheal.c
+++ b/xlators/cluster/dht/src/dht-selfheal.c
@@ -1065,7 +1065,7 @@ dht_selfheal_layout_new_directory (call_frame_t *frame, loc_t *loc,
total_size, chunk);
}
else {
- chunk = ((unsigned long) 0xffffffff) / bricks_used;
+ chunk = ((unsigned long) 0xffffffff) / bricks_to_use;
}
start_subvol = dht_selfheal_layout_alloc_start (this, loc, layout);