From 6609b1d37bd0254ec0eb068758862a0bb0e78515 Mon Sep 17 00:00:00 2001 From: Krishna Srinivas Date: Tue, 24 Feb 2009 06:55:39 -0800 Subject: DHT selfheal fix during lookup - create missing directories. Signed-off-by: Anand V. Avati --- xlators/cluster/dht/src/dht-layout.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/xlators/cluster/dht/src/dht-layout.c b/xlators/cluster/dht/src/dht-layout.c index 08b4a2746f8..1ec2e6c2edc 100644 --- a/xlators/cluster/dht/src/dht-layout.c +++ b/xlators/cluster/dht/src/dht-layout.c @@ -425,6 +425,7 @@ int dht_layout_normalize (xlator_t *this, loc_t *loc, dht_layout_t *layout) { int ret = 0; + int i = 0; uint32_t holes = 0; uint32_t overlaps = 0; uint32_t missing = 0; @@ -462,6 +463,19 @@ dht_layout_normalize (xlator_t *this, loc_t *loc, dht_layout_t *layout) ret = 1; } + for (i = 0; i < layout->cnt; i++) { + /* TODO During DHT selfheal rewrite (almost) find a better place to + * detect this - probably in dht_layout_anomalies() + */ + if (layout->list[i].err == ENOENT) { + gf_log (this->name, GF_LOG_WARNING, + "path=%s ENOENT - directory entry" + " should be created in selfheal", loc->path); + ret = 1; + break; + } + } + out: return ret; } -- cgit