summaryrefslogtreecommitdiffstats
path: root/xlators/features/quota
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2011-06-01 08:00:03 +0000
committerAnand Avati <avati@gluster.com>2011-07-11 23:19:11 -0700
commite9d960391794db917bd3e984c8dc3fd7e3cec706 (patch)
treeeab87e2285414c18ceaface453364922cc5eb318 /xlators/features/quota
parentcf395e9af76de16162328fbcf0aef4e8c72adfb8 (diff)
quota: update limit stored in inode-ctx when limit is removed on a directory.
Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2971 (quota remove command doesn't remove quota on directories.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2971
Diffstat (limited to 'xlators/features/quota')
-rw-r--r--xlators/features/quota/src/quota.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c
index 8f63c7aea63..6f5402b4b03 100644
--- a/xlators/features/quota/src/quota.c
+++ b/xlators/features/quota/src/quota.c
@@ -588,12 +588,17 @@ quota_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
quota_dentry_t *dentry = NULL;
quota_priv_t *priv = NULL;
int64_t *size = 0;
+ uint64_t value = 0;
local = frame->local;
+ inode_ctx_get (inode, this, &value);
+ ctx = (quota_inode_ctx_t *)(unsigned long)value;
+
if ((op_ret < 0) || (local == NULL)
- || ((local->limit < 0) && !((IA_ISREG (buf->ia_type))
- || (IA_ISLNK (buf->ia_type))))) {
+ || (((ctx == NULL) || (ctx->limit == local->limit))
+ && (local->limit < 0) && !((IA_ISREG (buf->ia_type))
+ || (IA_ISLNK (buf->ia_type))))) {
goto unwind;
}