From 3d3176958b7da48dbacb1a5a0fedf26322a38297 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 This is a backport of http://review.gluster.org/#/c/12386/ 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 Change-Id: I67b1b930b28411d76b2d476a4e5250c52aa495a0 BUG: 1277080 Signed-off-by: vmallika Reviewed-on: http://review.gluster.org/12487 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Raghavendra G Tested-by: Raghavendra G --- xlators/features/marker/src/marker-quota-helper.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'xlators/features/marker/src/marker-quota-helper.c') diff --git a/xlators/features/marker/src/marker-quota-helper.c b/xlators/features/marker/src/marker-quota-helper.c index df76f12cf47..4aba599e12e 100644 --- a/xlators/features/marker/src/marker-quota-helper.c +++ b/xlators/features/marker/src/marker-quota-helper.c @@ -260,19 +260,19 @@ mq_dict_set_contribution (xlator_t *this, dict_t *dict, loc_t *loc, uuid_t gfid, char *contri_key) { int32_t ret = -1; - char key[CONTRI_KEY_MAX] = {0, }; + char key[QUOTA_KEY_MAX] = {0, }; GF_VALIDATE_OR_GOTO ("marker", this, out); GF_VALIDATE_OR_GOTO ("marker", dict, out); GF_VALIDATE_OR_GOTO ("marker", loc, out); if (gfid && !gf_uuid_is_null(gfid)) { - GET_CONTRI_KEY (key, gfid, ret); + GET_CONTRI_KEY (this, key, gfid, ret); } else if (loc->parent) { - GET_CONTRI_KEY (key, loc->parent->gfid, ret); + GET_CONTRI_KEY (this, key, loc->parent->gfid, ret); } else { /* nameless lookup, fetch contributions to all parents */ - GET_CONTRI_KEY (key, NULL, ret); + GET_CONTRI_KEY (this, key, NULL, ret); } if (ret < 0) @@ -283,7 +283,7 @@ mq_dict_set_contribution (xlator_t *this, dict_t *dict, loc_t *loc, goto out; if (contri_key) - strncpy (contri_key, key, CONTRI_KEY_MAX); + strncpy (contri_key, key, QUOTA_KEY_MAX); out: if (ret < 0) -- cgit