From d90b87eed2fa68df5afcebbc54747e96f6d76cfb Mon Sep 17 00:00:00 2001 From: vmallika Date: Thu, 15 Oct 2015 12:41:13 +0530 Subject: quota: add version to quota xattrs When a quota is disable and the clean-up process terminated without completely cleaning-up the quota xattrs. Now when quota is enabled again, this can mess-up the accounting A version number is suffixed for all quota xattrs and this version number is specific to marker xaltor, i.e when quota xattrs are requested by quotad/client marker will remove the version suffix in the key before sending the response Change-Id: I1ca2c11460645edba0f6b68db70d476d8d26e1eb BUG: 1272411 Signed-off-by: vmallika Reviewed-on: http://review.gluster.org/12386 Tested-by: NetBSD Build System Reviewed-by: Krishnan Parthasarathi Tested-by: Gluster Build System Reviewed-by: Manikandan Selvaganesh Reviewed-by: Raghavendra G --- xlators/cluster/stripe/src/stripe-helpers.c | 2 +- xlators/cluster/stripe/src/stripe.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'xlators/cluster/stripe/src') diff --git a/xlators/cluster/stripe/src/stripe-helpers.c b/xlators/cluster/stripe/src/stripe-helpers.c index 3c12809d625..02ee6a43d7c 100644 --- a/xlators/cluster/stripe/src/stripe-helpers.c +++ b/xlators/cluster/stripe/src/stripe-helpers.c @@ -51,7 +51,7 @@ stripe_aggregate (dict_t *this, char *key, data_t *value, void *data) dst = data; - if (strcmp (key, GF_XATTR_QUOTA_SIZE_KEY) == 0) { + if (strcmp (key, QUOTA_SIZE_KEY) == 0) { ret = dict_get_bin (dst, key, (void **)&size); if (ret < 0) { size = GF_CALLOC (1, sizeof (int64_t), diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c index 5184ccdb959..78479129620 100644 --- a/xlators/cluster/stripe/src/stripe.c +++ b/xlators/cluster/stripe/src/stripe.c @@ -5515,8 +5515,8 @@ stripe_getxattr (call_frame_t *frame, xlator_t *this, loc_copy (&local->loc, loc); - if (name && strncmp (name, GF_XATTR_QUOTA_SIZE_KEY, - strlen (GF_XATTR_QUOTA_SIZE_KEY)) == 0) { + if (name && strncmp (name, QUOTA_SIZE_KEY, + strlen (QUOTA_SIZE_KEY)) == 0) { local->wind_count = priv->child_count; for (i = 0, trav=this->children; i < priv->child_count; i++, -- cgit