From c2cd3aeb0d88117f0929a733e9b05aa3e4d392ac Mon Sep 17 00:00:00 2001 From: vmallika Date: Wed, 8 Jul 2015 22:22:50 +0530 Subject: quota/marker: fix spurious failure afr-quota-xattr-mdata-heal.t During quota-update process if inode info is present in size-xattr and missing in contri-xattrs, then in function '_mq_get_metadata', we set contri-size as zero (on error -2, which means usage info present, but inode info missing). With this we are calculating wrong delta and updating the same. With this patch we are ignoring errors if inode info in xattrs are missing Change-Id: I7940a0e299b8bb425b5b43746b1f13f775c7fb92 BUG: 1241153 Signed-off-by: vmallika Reviewed-on: http://review.gluster.org/11583 Reviewed-by: Raghavendra G Tested-by: Raghavendra G --- libglusterfs/src/quota-common-utils.c | 14 +++++++++++++- libglusterfs/src/quota-common-utils.h | 3 +++ 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'libglusterfs') diff --git a/libglusterfs/src/quota-common-utils.c b/libglusterfs/src/quota-common-utils.c index 8c528c8bd3b..0c93303a5ae 100644 --- a/libglusterfs/src/quota-common-utils.c +++ b/libglusterfs/src/quota-common-utils.c @@ -57,7 +57,7 @@ out: } int32_t -quota_dict_get_meta (dict_t *dict, char *key, quota_meta_t *meta) +quota_dict_get_inode_meta (dict_t *dict, char *key, quota_meta_t *meta) { int32_t ret = -1; data_t *data = NULL; @@ -76,6 +76,18 @@ out: return ret; } +int32_t +quota_dict_get_meta (dict_t *dict, char *key, quota_meta_t *meta) +{ + int32_t ret = -1; + + ret = quota_dict_get_inode_meta (dict, key, meta); + if (ret == -2) + ret = 0; + + return ret; +} + int32_t quota_dict_set_meta (dict_t *dict, char *key, const quota_meta_t *meta, ia_type_t ia_type) diff --git a/libglusterfs/src/quota-common-utils.h b/libglusterfs/src/quota-common-utils.h index 2c3632b903c..c930db8e86c 100644 --- a/libglusterfs/src/quota-common-utils.h +++ b/libglusterfs/src/quota-common-utils.h @@ -40,6 +40,9 @@ typedef struct _quota_meta quota_meta_t; int32_t quota_data_to_meta (data_t *data, char *key, quota_meta_t *meta); +int32_t +quota_dict_get_inode_meta (dict_t *dict, char *key, quota_meta_t *meta); + int32_t quota_dict_get_meta (dict_t *dict, char *key, quota_meta_t *meta); -- cgit