diff options
author | Ravishankar N <ravishankar@redhat.com> | 2017-09-26 14:03:52 +0530 |
---|---|---|
committer | Shyamsundar Ranganathan <srangana@redhat.com> | 2017-10-05 10:30:22 +0000 |
commit | ccec52220f4d2fb148c1bb1573a11b1727af7a0c (patch) | |
tree | ba7886d63d443aac999ea93230149a45a9f1ee8a /xlators | |
parent | 23e6587cad304890f8c19ff0b37833e9ae67b774 (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: 1496321
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Diffstat (limited to 'xlators')
-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 0d08bee861e..5c45a3143cf 100644 --- a/xlators/cluster/afr/src/afr-self-heal-common.c +++ b/xlators/cluster/afr/src/afr-self-heal-common.c @@ -939,13 +939,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; @@ -963,7 +964,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) { |