summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorvmallika <vmallika@redhat.com>2015-06-18 16:31:57 +0530
committerRaghavendra G <rgowdapp@redhat.com>2015-06-27 02:42:35 -0700
commitc2f577c1caea959caf6d3c4b00f7c68c34a26edb (patch)
tree358a18b8137b35bec2eae1bfccb986c776e84d6a /xlators
parent3741804bec65a33d400af38dcc80700c8a668b81 (diff)
quota: Fix statfs values in EC when quota_deem_statfs is enabled
When quota_deem_statfs is enabled, quota sends aggregated statfs values In EC we should not multiply statfs values with fragment number Change-Id: I7ef8ea1598d84b86ba5c5941a2bbe0a6ab43c101 BUG: 1233162 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/11315 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/ec/src/ec-generic.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/xlators/cluster/ec/src/ec-generic.c b/xlators/cluster/ec/src/ec-generic.c
index d8c6d91fa89..6ffdbcf01d1 100644
--- a/xlators/cluster/ec/src/ec-generic.c
+++ b/xlators/cluster/ec/src/ec-generic.c
@@ -1107,7 +1107,9 @@ void ec_wind_statfs(ec_t * ec, ec_fop_data_t * fop, int32_t idx)
int32_t ec_manager_statfs(ec_fop_data_t * fop, int32_t state)
{
- ec_cbk_data_t * cbk;
+ ec_cbk_data_t *cbk = NULL;
+ gf_boolean_t deem_statfs_enabled = _gf_false;
+ int ret = 0;
switch (state)
{
@@ -1137,9 +1139,15 @@ int32_t ec_manager_statfs(ec_fop_data_t * fop, int32_t state)
{
ec_t * ec = fop->xl->private;
- cbk->statvfs.f_blocks *= ec->fragments;
- cbk->statvfs.f_bfree *= ec->fragments;
- cbk->statvfs.f_bavail *= ec->fragments;
+ if (cbk->xdata)
+ ret = dict_get_int8 (cbk->xdata, "quota-deem-statfs",
+ (int8_t *)&deem_statfs_enabled);
+
+ if (ret != 0 || deem_statfs_enabled == _gf_false) {
+ cbk->statvfs.f_blocks *= ec->fragments;
+ cbk->statvfs.f_bfree *= ec->fragments;
+ cbk->statvfs.f_bavail *= ec->fragments;
+ }
}
}
else