diff options
author | vmallika <vmallika@redhat.com> | 2015-10-15 12:41:13 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2015-11-02 00:54:35 -0800 |
commit | d90b87eed2fa68df5afcebbc54747e96f6d76cfb (patch) | |
tree | 2d514ae4211e29ff42f1e615a4e7d0d45721512b /xlators/features/marker/src/marker-quota-helper.c | |
parent | d3e496cbcd35b9d9b840e328ae109c44f59083ce (diff) |
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 <vmallika@redhat.com>
Reviewed-on: http://review.gluster.org/12386
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Manikandan Selvaganesh <mselvaga@redhat.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/features/marker/src/marker-quota-helper.c')
-rw-r--r-- | xlators/features/marker/src/marker-quota-helper.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/xlators/features/marker/src/marker-quota-helper.c b/xlators/features/marker/src/marker-quota-helper.c index 5611c1d8bdc..d1fabccf18e 100644 --- a/xlators/features/marker/src/marker-quota-helper.c +++ b/xlators/features/marker/src/marker-quota-helper.c @@ -255,19 +255,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) @@ -278,7 +278,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) |