From 2b2bddecb13465486fdcd9599bbdd95b23151c9d Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Sun, 10 Jul 2011 23:30:55 +0000 Subject: quota: update limit stored in inode-ctx when limit is removed on a directory. Signed-off-by: Raghavendra G Signed-off-by: Anand Avati BUG: 2971 (quota remove command doesn't remove quota on directories.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2971 --- xlators/features/quota/src/quota.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'xlators/features') diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c index 5d1f304f4..8071a1491 100644 --- a/xlators/features/quota/src/quota.c +++ b/xlators/features/quota/src/quota.c @@ -583,12 +583,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; } -- cgit