From 103d82700483bf744f86719e97846b065ca3394c Mon Sep 17 00:00:00 2001 From: "Anand V. Avati" Date: Wed, 18 Mar 2009 17:10:51 +0530 Subject: dht_layout_dir_cmp - if xattr is missing, it is an error only if cached layout has entry for that subvolume. --- xlators/cluster/dht/src/dht-layout.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'xlators/cluster/dht/src/dht-layout.c') diff --git a/xlators/cluster/dht/src/dht-layout.c b/xlators/cluster/dht/src/dht-layout.c index 1515df697..a45625876 100644 --- a/xlators/cluster/dht/src/dht-layout.c +++ b/xlators/cluster/dht/src/dht-layout.c @@ -512,7 +512,8 @@ dht_layout_dir_mismatch (xlator_t *this, dht_layout_t *layout, xlator_t *subvol, { int idx = 0; int pos = -1; - int ret = -1; + int ret = 0; + int err = 0; int32_t *disk_layout = NULL; int32_t count = -1; uint32_t start_off = -1; @@ -533,12 +534,16 @@ dht_layout_dir_mismatch (xlator_t *this, dht_layout_t *layout, xlator_t *subvol, ret = 1; goto out; } - - if (xattr == NULL) { - gf_log (this->name, GF_LOG_ERROR, - "%s - xattr dictionary is NULL", - loc->path); - ret = -1; + + err = layout->list[pos].err; + + if (!xattr) { + if (err == 0) { + gf_log (this->name, GF_LOG_ERROR, + "%s - xattr dictionary is NULL", + loc->path); + ret = -1; + } goto out; } @@ -546,9 +551,11 @@ dht_layout_dir_mismatch (xlator_t *this, dht_layout_t *layout, xlator_t *subvol, VOID(&disk_layout)); if (ret < 0) { - gf_log (this->name, GF_LOG_ERROR, - "%s - disk layout missing", loc->path); - ret = -1; + if (err == 0) { + gf_log (this->name, GF_LOG_ERROR, + "%s - disk layout missing", loc->path); + ret = -1; + } goto out; } @@ -566,7 +573,7 @@ dht_layout_dir_mismatch (xlator_t *this, dht_layout_t *layout, xlator_t *subvol, if ((layout->list[pos].start != start_off) || (layout->list[pos].stop != stop_off)) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "subvol: %s; inode layout - %"PRId32" - %"PRId32"; " "disk layout - %"PRId32" - %"PRId32, layout->list[pos].xlator->name, -- cgit