summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2015-03-10 22:11:57 +0530
committerRaghavendra Bhat <raghavendra@redhat.com>2015-03-16 02:45:43 -0700
commitb46bd7feadd77374ba3d40ac19e127b2073b51d5 (patch)
treea89c4f6d87695c2b3791636fae9cd27c1ec7b9e6
parentc5f344e4c3724cd08d3a3f48084ef5da504f6628 (diff)
cluster/afr: Convert quota size from n/w to host order before use
Backport of: http://review.gluster.org/9853 Change-Id: I83f1ab16a2dc54841e7beff3033333fba009b3a4 BUG: 1201622 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/9884 Reviewed-by: Ravishankar N <ravishankar@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anuradha Talur <atalur@redhat.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
-rw-r--r--xlators/cluster/afr/src/afr-inode-read.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr-inode-read.c b/xlators/cluster/afr/src/afr-inode-read.c
index 1bed4d9fb41..3c178c20fd5 100644
--- a/xlators/cluster/afr/src/afr-inode-read.c
+++ b/xlators/cluster/afr/src/afr-inode-read.c
@@ -30,6 +30,7 @@
#include "stack.h"
#include "list.h"
#include "call-stub.h"
+#include "byte-order.h"
#include "defaults.h"
#include "common-utils.h"
#include "compat-errno.h"
@@ -78,6 +79,7 @@ afr_handle_quota_size (call_frame_t *frame, xlator_t *this)
continue;
if (dict_get_uint64 (replies[i].xdata, QUOTA_SIZE_KEY, &size))
continue;
+ size = ntoh64 (size);
if (read_subvol == -1)
read_subvol = i;
if (size > max_size) {
@@ -89,6 +91,8 @@ afr_handle_quota_size (call_frame_t *frame, xlator_t *this)
if (!max_size)
return read_subvol;
+ max_size = hton64 (max_size);
+
for (i = 0; i < priv->child_count; i++) {
if (!replies[i].valid || replies[i].op_ret == -1)
continue;