From d2b8167aeb5f5559a16eef4604b46f71f3dbf894 Mon Sep 17 00:00:00 2001 From: Sanju Rakonde Date: Tue, 12 Mar 2019 06:48:52 +0000 Subject: Revert "libglusterfs/common-utils.c: Fix buffer size for checksum computation" This reverts commit 421b7071f5acee064faf02dc91bcc83efbaa6523. With this commit, the way glusterd calculates the checksum changes. In a heterogeneous cluster, upgraded and non-upgraded nodes follow different mechanisms to compute the checksum. Although the contents of files are same, we will see checksum mismatch errors and peers will run into the rejected state. reverted patch: https://review.gluster.org/#/c/glusterfs/+/22149/ updates: bz#1672249 Change-Id: Ie12e1ac983d62594b161844b2967d8a3fbfedba6 Signed-off-by: Sanju Rakonde --- libglusterfs/src/common-utils.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libglusterfs') diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c index 70b90104b87..e2874602a84 100644 --- a/libglusterfs/src/common-utils.c +++ b/libglusterfs/src/common-utils.c @@ -1874,7 +1874,7 @@ gf_unlockfd (int fd) } static void -compute_checksum (char *buf, const ssize_t size, uint32_t *checksum) +compute_checksum (char *buf, size_t size, uint32_t *checksum) { int ret = -1; char *checksum_buf = NULL; @@ -1915,7 +1915,8 @@ get_checksum_for_file (int fd, uint32_t *checksum) do { ret = sys_read (fd, &buf, GF_CHECKSUM_BUF_SIZE); if (ret > 0) - compute_checksum (buf, ret, checksum); + compute_checksum (buf, GF_CHECKSUM_BUF_SIZE, + checksum); } while (ret > 0); /* set it back */ -- cgit