summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-07-14 16:17:57 +0530
committerAnand Avati <avati@gluster.com>2011-07-26 23:48:17 -0700
commitb922437795a68b32cd6fb337dfd66a4ead13b4ee (patch)
treedc23ac6ddc7b3429fcff9d9c21dce62fc4275e82 /xlators
parent73eca3be5c5ccc71bbad934338c1ef58ed37c483 (diff)
cluster/distribute: while fixing layout, consider ENOSPC errors
in case of layout 'creation', layout->err == ENOSPC should be ignored where as, while layout 'fixing' we should consider what was already present in the layout. Change-Id: Ifb613b41065813c9f1202e65e94b4b0282766d11 BUG: 2258 Signed-off-by: Amar Tumballi <amar@gluster.com> Reviewed-on: http://review.gluster.com/15 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Shishir Gowda <shishirng@gluster.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/dht/src/dht-selfheal.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c
index 3d4f13c6f3f..8245cacdc25 100644
--- a/xlators/cluster/dht/src/dht-selfheal.c
+++ b/xlators/cluster/dht/src/dht-selfheal.c
@@ -457,7 +457,7 @@ dht_selfheal_layout_alloc_start (xlator_t *this, loc_t *loc,
}
static inline int
-dht_get_layout_count (xlator_t *this, dht_layout_t *layout)
+dht_get_layout_count (xlator_t *this, dht_layout_t *layout, int new_layout)
{
int i = 0;
int err = 0;
@@ -472,7 +472,7 @@ dht_get_layout_count (xlator_t *this, dht_layout_t *layout)
}
/* no subvolume has enough space, but can't stop directory creation */
- if (!count) {
+ if (!count || !new_layout) {
for (i = 0; i < layout->cnt; i++) {
err = layout->list[i].err;
if (err == ENOSPC) {
@@ -516,7 +516,7 @@ dht_fix_layout_of_directory (call_frame_t *frame, loc_t *loc,
priv = this->private;
local = frame->local;
- count = cnt = dht_get_layout_count (this, layout);
+ count = cnt = dht_get_layout_count (this, layout, 0);
chunk = ((unsigned long) 0xffffffff) / ((cnt) ? cnt : 1);
@@ -655,7 +655,7 @@ dht_selfheal_layout_new_directory (call_frame_t *frame, loc_t *loc,
this = frame->this;
- cnt = dht_get_layout_count (this, layout);
+ cnt = dht_get_layout_count (this, layout, 1);
chunk = ((unsigned long) 0xffffffff) / ((cnt) ? cnt : 1);