From 1509f6f2815cb75ecf45abef6d823c8cb30ed47b Mon Sep 17 00:00:00 2001 From: vmallika Date: Fri, 10 Jul 2015 13:29:13 +0530 Subject: quota/marker: fix spurious failure afr-quota-xattr-mdata-heal.t This is a backport of http://review.gluster.org/#/c/11583 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 Change-Id: Ie85fa84b5362ae179cc43402bd6a3a6d96a04b81 BUG: 1241831 Signed-off-by: vmallika Reviewed-on: http://review.gluster.org/11614 Tested-by: Gluster Build System Tested-by: NetBSD Build System Reviewed-by: Krishnan Parthasarathi --- cli/src/cli-rpc-ops.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'cli') diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 57e11fa83fd..dfc5c6b1781 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -3292,16 +3292,12 @@ print_quota_list_from_quotad (call_frame_t *frame, dict_t *rsp_dict) limits.hl = ntoh64 (size_limits->hl); limits.sl = ntoh64 (size_limits->sl); - ret = quota_dict_get_meta (rsp_dict, QUOTA_SIZE_KEY, &used_space); - if (ret == -2 && type == GF_QUOTA_OPTION_TYPE_LIST) { - ret = 0; - /* quota_dict_get_meta returns -2 if metadata for inode - * quotas is missing. - * This can happen when glusterfs is upgraded from 3.6 to 3.7 - * and the xattr healing is not completed. - * We can contiue as success if we are listing only file usage - */ - } + if (type == GF_QUOTA_OPTION_TYPE_LIST) + ret = quota_dict_get_meta (rsp_dict, QUOTA_SIZE_KEY, + &used_space); + else + ret = quota_dict_get_inode_meta (rsp_dict, QUOTA_SIZE_KEY, + &used_space); if (ret < 0) { gf_log ("cli", GF_LOG_WARNING, -- cgit