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/mgmt/glusterd/src/glusterd-store.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/mgmt/glusterd/src/glusterd-store.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-store.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c index b9991b36c68..6d4fce23463 100644 --- a/xlators/mgmt/glusterd/src/glusterd-store.c +++ b/xlators/mgmt/glusterd/src/glusterd-store.c @@ -1008,6 +1008,12 @@ glusterd_volume_exclude_options_write (int fd, glusterd_volinfo_t *volinfo) goto out; } + snprintf (buf, sizeof (buf), "%d", volinfo->quota_version); + ret = gf_store_save_value (fd, GLUSTERD_STORE_KEY_VOL_QUOTA_VERSION, + buf); + if (ret) + goto out; + ret = glusterd_volume_write_tier_details (fd, volinfo); ret = glusterd_volume_write_snap_details (fd, volinfo); @@ -2666,6 +2672,9 @@ glusterd_store_update_volinfo (glusterd_volinfo_t *volinfo) } else if (!strncmp (key, GLUSTERD_STORE_KEY_COLD_TYPE, strlen (key))) { volinfo->tier_info.cold_type = atoi (value); + } else if (!strncmp (key, GLUSTERD_STORE_KEY_VOL_QUOTA_VERSION, + strlen (GLUSTERD_STORE_KEY_VOL_QUOTA_VERSION))) { + volinfo->quota_version = atoi (value); } else { if (is_key_glusterd_hooks_friendly (key)) { |