summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/cluster/dht/src/dht-common.c5
-rw-r--r--xlators/cluster/dht/src/dht-rebalance.c15
2 files changed, 17 insertions, 3 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index c6eb5d8eae3..72ca77ea5ab 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -3535,8 +3535,6 @@ dht_setxattr (call_frame_t *frame, xlator_t *this,
tmp = dict_get (xattr, GF_XATTR_FIX_LAYOUT_KEY);
if (tmp) {
- gf_log (this->name, GF_LOG_INFO,
- "fixing the layout of %s", loc->path);
ret = dict_get_uint32(xattr, "new-commit-hash", &new_hash);
if (ret == 0) {
@@ -3554,6 +3552,9 @@ dht_setxattr (call_frame_t *frame, xlator_t *this,
return ret;
}
+ gf_log (this->name, GF_LOG_INFO,
+ "fixing the layout of %s", loc->path);
+
ret = dht_fix_directory_layout (frame, dht_common_setxattr_cbk,
layout);
if (ret) {
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c
index 6ba9dd1e463..3ab73d4ef5b 100644
--- a/xlators/cluster/dht/src/dht-rebalance.c
+++ b/xlators/cluster/dht/src/dht-rebalance.c
@@ -2341,7 +2341,7 @@ gf_defrag_settle_hash (xlator_t *this, gf_defrag_info_t *defrag,
loc_t *loc, dict_t *fix_layout)
{
int ret;
-
+ dht_conf_t *conf = NULL;
/*
* Now we're ready to update the directory commit hash for the volume
* root, so that hash miscompares and broadcast lookups can stop.
@@ -2355,6 +2355,19 @@ gf_defrag_settle_hash (xlator_t *this, gf_defrag_info_t *defrag,
return 0;
}
+ conf = this->private;
+ if (!conf) {
+ /*Uh oh
+ */
+ return -1;
+ }
+
+ if (conf->local_subvols_cnt == 0) {
+ /* Commit hash updates are only done on local subvolumes
+ */
+ return 0;
+ }
+
ret = dict_set_uint32 (fix_layout, "new-commit-hash",
defrag->new_commit_hash);
if (ret) {