diff options
author | vmallika <vmallika@redhat.com> | 2015-10-15 12:41:13 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2015-11-02 21:03:46 -0800 |
commit | 3d3176958b7da48dbacb1a5a0fedf26322a38297 (patch) | |
tree | 542b4e2ed19dc2dff66317d8f5b99536cce2f3e6 /xlators/mgmt/glusterd/src/glusterd-utils.c | |
parent | 0b6f0e09715fb2ba8f86bd80b05d552ae75aeda9 (diff) |
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 <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>
Change-Id: I67b1b930b28411d76b2d476a4e5250c52aa495a0
BUG: 1277080
Signed-off-by: vmallika <vmallika@redhat.com>
Reviewed-on: http://review.gluster.org/12487
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index b66cccde104..1a1a3b10c06 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -2493,6 +2493,9 @@ glusterd_add_volume_to_dict (glusterd_volinfo_t *volinfo, snprintf (key, sizeof (key), "%s%d.caps", prefix, count); ret = dict_set_int32 (dict, key, volinfo->caps); + memset (key, 0, sizeof (key)); + snprintf (key, sizeof (key), "%s%d.quota-version", prefix, count); + ret = dict_set_int32 (dict, key, volinfo->quota_version); out: GF_FREE (volume_id_str); GF_FREE (rebalance_id_str); @@ -3573,6 +3576,11 @@ glusterd_import_volinfo (dict_t *peer_data, int count, /*This is not present in older glusterfs versions, so ignore ret value*/ ret = dict_get_int32 (peer_data, key, &new_volinfo->caps); + memset (key, 0, sizeof (key)); + snprintf (key, sizeof (key), "%s%d.quota_version", prefix, count); + /*This is not present in older glusterfs versions, so ignore ret value*/ + ret = dict_get_int32 (peer_data, key, &new_volinfo->quota_version); + ret = glusterd_import_bricks (peer_data, count, new_volinfo, prefix); if (ret) goto out; |