summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-common.c
diff options
context:
space:
mode:
authorperrynzhou <perrynzhou@gmail.com>2020-09-29 17:22:42 +0800
committerRavishankar N <ravishankar@redhat.com>2020-10-01 13:52:12 +0000
commit268faabed00995537394c04ac168c018167fbe27 (patch)
treed01e152e7e0b94dcfcf222c5145627e06b977cc1 /xlators/cluster/afr/src/afr-common.c
parent9ecbd69127d373ac000e9e1be00c1829e49e64a4 (diff)
fixed AFR_READ_POLICY_GFID_PID_HASH policy bug
Change-Id: Ib927a770a486c95e4b157e76ba96e9904d1a9716 Fixes: #1499 Signed-off-by: perrynzhou <perrynzhou@gmail.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-common.c')
-rw-r--r--xlators/cluster/afr/src/afr-common.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index 1a4341a66d9..032ab5c8001 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -2306,8 +2306,9 @@ afr_hash_child(afr_read_subvol_args_t *args, afr_private_t *priv,
* need is a low probability that multiple clients
* won't converge on the same subvolume.
*/
+ gf_uuid_copy(gfid_copy, args->gfid);
pid = getpid();
- memcpy(gfid_copy, &pid, sizeof(pid));
+ *(pid_t *)gfid_copy ^= pid;
}
child = SuperFastHash((char *)gfid_copy, sizeof(gfid_copy)) %
priv->child_count;