diff options
author | Ravishankar N <ravishankar@redhat.com> | 2015-10-21 21:05:46 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2015-10-29 01:40:19 -0700 |
commit | 50646435b4076cfb30d7ebabf2d688f91c957cec (patch) | |
tree | 9ee11abc73bdb94492d42b0ed36e0ae11cf37ff2 /xlators/cluster/afr/src/afr.h | |
parent | 0ce29bbd6a1cc459d4f4ffc50a4658988ef52039 (diff) |
afr: write zeros to sink for non-sparse files
Backport of http://review.gluster.org/#/c/12371/
Problem: If a file is created with zeroes ('dd', 'fallocate' etc.) when
a brick is down, the self-heal does not write the zeroes to the sink
after it comes up. Consequenty, there is a mismatch in disk-usage
amongst the bricks of the replica.
Fix: If we definitely know that the file is not sparse, then write the
zeroes to the sink even if the checksums match.
Change-Id: Ic739b3da5dbf47d99801c0e1743bb13aeb3af864
BUG: 1275921
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: http://review.gluster.org/12436
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr.h')
-rw-r--r-- | xlators/cluster/afr/src/afr.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h index 9ee5ae36df0..c2fd1166d96 100644 --- a/xlators/cluster/afr/src/afr.h +++ b/xlators/cluster/afr/src/afr.h @@ -270,7 +270,9 @@ struct afr_reply { struct iatt preparent; struct iatt preparent2; struct iatt postparent2; + /* For rchecksum */ uint8_t checksum[MD5_DIGEST_LENGTH]; + gf_boolean_t buf_has_zeroes; }; typedef enum { |