diff options
author | vmallika <vmallika@redhat.com> | 2015-04-01 20:03:37 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2015-04-14 05:01:18 +0000 |
commit | 6e8298654a7d0de29192b88d769132cfc51c9ac7 (patch) | |
tree | c70306373aff2967ae0d3ecd4148d1aaae085e48 /cli/src | |
parent | d3b52c8283eb4c85018a5055a0dbe628b5bd2d29 (diff) |
quota/disperse: handle inode quotas in xattr aggregate
with the inode quota feature, quota size is now
increased from 64bit to 192bits which contains
values of 'file size', 'file count' and 'dir count'
This change in quota size xattr needs to be handled
in disperse xattr aggregation
Signed-off-by: vmallika <vmallika@redhat.com>
Change-Id: I5fd28aa9f5b8b6cba83a98360236417a97ac16ee
BUG: 1207967
Reviewed-on: http://review.gluster.org/10112
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Sachin Pandit <spandit@redhat.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'cli/src')
-rw-r--r-- | cli/src/cli-rpc-ops.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 0d57c858e43..7c5743af741 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -2783,7 +2783,14 @@ print_quota_list_from_mountdir (cli_local_t *local, char *mountdir, xattr_size = sys_lgetxattr (mountdir, "trusted.glusterfs.quota.size", NULL, 0); - if (xattr_size > (sizeof (int64_t) * 2)) { + if (xattr_size < (sizeof (int64_t) * 2) && + type == GF_QUOTA_OPTION_TYPE_LIST_OBJECTS) { + ret = -1; + + /* This can happen when glusterfs is upgraded from 3.6 to 3.7 + * and the xattr healing is not completed. + */ + } else if (xattr_size > (sizeof (int64_t) * 2)) { ret = sys_lgetxattr (mountdir, "trusted.glusterfs.quota.size", &used_space, sizeof (used_space)); } else if (xattr_size > 0) { @@ -2962,6 +2969,16 @@ print_quota_list_from_quotad (call_frame_t *frame, dict_t *rsp_dict) 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 (ret < 0) { gf_log ("cli", GF_LOG_WARNING, "size key not present in dict"); |