summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2012-04-14 18:02:05 +0530
committerVijay Bellur <vijay@gluster.com>2012-04-16 11:20:06 -0700
commitc75a5d348f0d30b61bdc45e9e54d623957a6050f (patch)
tree41bca6bf21a85f9ff3c67c0639526feaca3b9764
parent369873fbeac1c33bf5f2468e475c3a08608e8965 (diff)
cluster/afr: increment change log with correct byte order
Change-Id: Id2af3e61ad659ff6d168161673e5e1e19f36bdb5 BUG: 765194 Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.com/3149 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
-rw-r--r--xlators/cluster/afr/src/afr-transaction.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c
index 7a95f310afe..c46ec6cf611 100644
--- a/xlators/cluster/afr/src/afr-transaction.c
+++ b/xlators/cluster/afr/src/afr-transaction.c
@@ -515,6 +515,7 @@ afr_changelog_post_op (call_frame_t *frame, xlator_t *this)
int piggyback = 0;
int index = 0;
int nothing_failed = 1;
+ int32_t changelog = 0;
local = frame->local;
int_lock = &local->internal_lock;
@@ -562,8 +563,10 @@ afr_changelog_post_op (call_frame_t *frame, xlator_t *this)
if (local->optimistic_change_log &&
local->transaction.type != AFR_DATA_TRANSACTION) {
/* if nothing_failed, then local->pending[..] == {0 .. 0} */
- for (i = 0; i < priv->child_count; i++)
- local->pending[i][index]++;
+ for (i = 0; i < priv->child_count; i++) {
+ changelog = ntoh32 (local->pending[i][index]);
+ local->pending[i][index] = hton32 (changelog + 1);
+ }
}
for (i = 0; i < priv->child_count; i++) {