summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/ec/src/ec.c
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2015-03-31 23:07:09 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2015-05-04 19:46:32 -0700
commitc8cd488b794d7abb3d37f32a6d8d0a3b365aa46e (patch)
tree08c853a509ca346ea362ba2c77ec13a6f1b91677 /xlators/cluster/ec/src/ec.c
parent582b252e3a418ee332cf3d4b1a415520e242b599 (diff)
cluster/ec: Fix dictionary compare function
If both dicts are NULL then equal. If one of the dicts is NULL but the other has only ignorable keys then also they are equal. If both dicts are non-null then check if for each non-ignorable key, values are same or not. value_ignore function is used to skip comparing values for the keys which must be present in both the dictionaries but the value could be different. geo-rep's stime xattr doesn't need to be present in list xattr but when getxattr comes on stime xattr even if there aren't enough responses with the xattr we should still give out an answer which is maximum of the stimes available. Change-Id: I8de2ceaa2db785b797f302f585d88e73b154167d BUG: 1207712 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/10078 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
Diffstat (limited to 'xlators/cluster/ec/src/ec.c')
-rw-r--r--xlators/cluster/ec/src/ec.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/xlators/cluster/ec/src/ec.c b/xlators/cluster/ec/src/ec.c
index 5476ac6562e..3dd04299541 100644
--- a/xlators/cluster/ec/src/ec.c
+++ b/xlators/cluster/ec/src/ec.c
@@ -670,6 +670,7 @@ ec_gf_getxattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
{
int error = 0;
ec_t *ec = this->private;
+ int32_t minimum = EC_MINIMUM_MIN;
if (name && strcmp (name, EC_XATTR_HEAL) != 0) {
EC_INTERNAL_XATTR_OR_GOTO(name, NULL, error, out);
@@ -682,7 +683,10 @@ ec_gf_getxattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
NULL, ec_marker_populate_args) == 0)
return 0;
- ec_getxattr (frame, this, -1, EC_MINIMUM_MIN, default_getxattr_cbk,
+ if (name && (fnmatch (GF_XATTR_STIME_PATTERN, name, 0) == 0))
+ minimum = EC_MINIMUM_ALL;
+
+ ec_getxattr (frame, this, -1, minimum, default_getxattr_cbk,
NULL, loc, name, xdata);
return 0;