summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorN Balachandran <nbalacha@redhat.com>2018-03-14 10:05:06 +0530
committerjiffin tony Thottan <jthottan@redhat.com>2018-04-06 12:50:35 +0000
commit9af1915e6135d5f699172f838342795b3b9d775d (patch)
tree212e194a6e818ed83ddb023cb23b27866af851e7
parent14b7a7b63c970b735c4f7e8be9e6f31dd148c6f9 (diff)
cluster/dht: Skipped files are not treated as errors
For skipped files, use a return value of 1 to prevent error messages being logged. > Change-Id: I18de31ac1a64d4460e88dea7826c3ba03c895861 > BUG: 1553598 > Signed-off-by: N Balachandran <nbalacha@redhat.com> Change-Id: I18de31ac1a64d4460e88dea7826c3ba03c895861 BUG: 1555161 Signed-off-by: N Balachandran <nbalacha@redhat.com>
-rw-r--r--xlators/cluster/dht/src/dht-rebalance.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c
index 6fd21ebaac8..9e5408f12c1 100644
--- a/xlators/cluster/dht/src/dht-rebalance.c
+++ b/xlators/cluster/dht/src/dht-rebalance.c
@@ -594,7 +594,7 @@ __check_file_has_hardlink (xlator_t *this, loc_t *loc,
"Migration skipped for:"
"%s: file has hardlinks", loc->path);
*fop_errno = ENOTSUP;
- ret = -1;
+ ret = 1;
}
}
@@ -649,7 +649,7 @@ __is_file_migratable (xlator_t *this, loc_t *loc,
"Migrate file failed: %s: File has locks."
" Skipping file migration", loc->path);
*fop_errno = ENOTSUP;
- ret = -1;
+ ret = 1;
goto out;
}
}
@@ -1015,7 +1015,7 @@ __dht_check_free_space (xlator_t *this, xlator_t *to, xlator_t *from,
/* this is not a 'failure', but we don't want to
consider this as 'success' too :-/ */
*fop_errno = ENOSPC;
- ret = -1;
+ ret = 1;
goto out;
}
}
@@ -2730,7 +2730,7 @@ gf_defrag_migrate_single_file (void *opaque)
ret = dht_migrate_file (this, &entry_loc, cached_subvol,
hashed_subvol, rebal_type, &fop_errno);
- if (ret < 0) {
+ if (ret == 1) {
if (fop_errno == ENOSPC) {
gf_msg_debug (this->name, 0, "migrate-data skipped for"
" %s due to space constraints",
@@ -2779,8 +2779,12 @@ gf_defrag_migrate_single_file (void *opaque)
DHT_MSG_MIGRATE_FILE_SKIPPED,
"File migration skipped for %s.",
entry_loc.path);
+ }
+
+ ret = 0;
- } else if (fop_errno != EEXIST) {
+ } else if (ret < 0) {
+ if (fop_errno != EEXIST) {
gf_msg (this->name, GF_LOG_ERROR, fop_errno,
DHT_MSG_MIGRATE_FILE_FAILED,
"migrate-data failed for %s", entry_loc.path);