summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-self-heal-common.c
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2017-09-26 14:03:52 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2017-09-27 03:03:40 +0000
commit24637d54dcbc06de8a7de17c75b9291fcfcfbc84 (patch)
treeb064d3713735e7aa101afd9030d8af3426eefb76 /xlators/cluster/afr/src/afr-self-heal-common.c
parent13d2af4ffeb3b968a3c4675247513d429972d31d (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. Change-Id: I69e55d3c842c7636e3538d1b57bc4deca67bed05 BUG: 1491670 Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-common.c')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-common.c13
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) {