Skip to content

Commit

Permalink
fixed AFR_READ_POLICY_GFID_PID_HASH policy bug
Browse files Browse the repository at this point in the history
Change-Id: Ib927a770a486c95e4b157e76ba96e9904d1a9716
Fixes: #1499
Signed-off-by: perrynzhou <[email protected]>
  • Loading branch information
perrynzhou authored and itisravi committed Oct 14, 2020
1 parent 61ee44f commit f9a3da7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion xlators/cluster/afr/src/afr-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1640,8 +1640,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;
Expand Down

0 comments on commit f9a3da7

Please sign in to comment.