From 865cca1190e233381f975ff36118f46e29477dcf Mon Sep 17 00:00:00 2001 From: nik-redhat Date: Wed, 26 Aug 2020 15:08:56 +0530 Subject: glusterd: cksum mismatch on upgrading to latest gluster Issue: In gluster versions less than 7, the checksums were calculated whether or not the quota is enabled or not, and that cksum value was also getting stored in the quota.cksum file. But, from gluster 7 version onwards cksum was calculated only if the quota is enabled. Due to this, the cksums in quota.cksum files differ after upgrading. Fix: Added a check to see if the OP_VERSION is less than 7 then, follow the previous method otherwise, move as per the latest changes for cksum calculation. This changes for the cksum calculation was done in this commit : https://github.com/gluster/glusterfs/commit/3b5eb592f5 Fixes: #1332 Change-Id: I7a95e5e5f4d4be4983fb7816225bf9187856c003 Signed-off-by: nik-redhat --- xlators/mgmt/glusterd/src/glusterd-utils.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 64653cb6052..04790bbc75c 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -2796,6 +2796,15 @@ glusterd_volume_compute_cksum(glusterd_volinfo_t *volinfo, char *cksum_path, ret = -1; goto out; } + } else if (priv->op_version < GD_OP_VERSION_7_0) { + ret = get_checksum_for_path(filepath, &cksum, priv->op_version); + if (ret) { + gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_CKSUM_GET_FAIL, + "unable to get " + "checksum for path: %s", + filepath); + goto out; + } } ret = get_checksum_for_file(fd, &cksum, priv->op_version); -- cgit