diff options
author | Ravishankar N <ravishankar@redhat.com> | 2017-09-26 14:03:52 +0530 |
---|---|---|
committer | Ravishankar N <ravishankar@redhat.com> | 2017-10-05 12:54:40 +0000 |
commit | 07f07554acea41e2faae88724664491eb00a35f4 (patch) | |
tree | 541a859f890dc3fcc9866be3dcb222a6d4e3e1ce /xlators/cluster | |
parent | 75ba5426232cbdbac87f74725a468bb4c9b956f0 (diff) |
afr: don't check for file size in afr_mark_source_sinks_if_file_empty
... for AFR_METADATA_TRANSACTION and just mark source and sinks if
metadata is the same.
(cherry picked from commit 24637d54dcbc06de8a7de17c75b9291fcfcfbc84)
Change-Id: I69e55d3c842c7636e3538d1b57bc4deca67bed05
BUG: 1496317
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Diffstat (limited to 'xlators/cluster')
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-common.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c index 6a159dc67d0..55b978bf962 100644 --- a/xlators/cluster/afr/src/afr-self-heal-common.c +++ b/xlators/cluster/afr/src/afr-self-heal-common.c @@ -1189,13 +1189,14 @@ afr_mark_source_sinks_if_file_empty (xlator_t *this, unsigned char *sources, (afr_success_count(replies, priv->child_count) < priv->child_count)) return -1; - for (i = 0; i < priv->child_count; i++) { - if (replies[i].poststat.ia_size != 0) - return -1; - } + if (type == AFR_DATA_TRANSACTION) { + for (i = 0; i < priv->child_count; i++) { + if (replies[i].poststat.ia_size != 0) + return -1; + } - if (type == AFR_DATA_TRANSACTION) goto mark; + } /*For AFR_METADATA_TRANSACTION, metadata must be same on all bricks.*/ stbuf = replies[0].poststat; @@ -1213,7 +1214,7 @@ afr_mark_source_sinks_if_file_empty (xlator_t *this, unsigned char *sources, } mark: - /* All bricks have a zero-byte file. Pick one of them as source. Rest + /* data/metadata is same on all bricks. Pick one of them as source. Rest * are sinks.*/ for (i = 0 ; i < priv->child_count; i++) { if (source == -1) { |