summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2011-04-13 10:37:31 +0000
committerAnand Avati <avati@gluster.com>2011-04-14 01:00:50 -0700
commit77cd50a12887b13db4c49be6a979a5ecb8239570 (patch)
tree70cb5409f8a64b575cef0fb778f1fbca8e84cf37 /xlators
parent55594008c2d719c7097998b3d8aa9771bcc9d3ff (diff)
quota/(f)truncate: pass correct delta for updating parent sizes after successful completion.
Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2741 (Quota: new files not getting created even if space is available) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2741
Diffstat (limited to 'xlators')
-rw-r--r--xlators/features/quota/src/quota.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c
index b68689ed91a..d3b970264ca 100644
--- a/xlators/features/quota/src/quota.c
+++ b/xlators/features/quota/src/quota.c
@@ -343,7 +343,7 @@ quota_check_limit (call_frame_t *frame, inode_t *inode, xlator_t *this,
if (ctx != NULL) {
LOCK (&ctx->lock);
{
- if (ctx->limit > 0) {
+ if (ctx->limit >= 0) {
if (!just_validated
&& quota_timeout (&ctx->tv,
priv->timeout)) {
@@ -750,7 +750,7 @@ quota_update_size (xlator_t *this, inode_t *inode, char *name, ino_t par,
_inode = inode_ref (inode);
do {
- if (ctx != NULL) {
+ if ((ctx != NULL) && (ctx->limit >= 0)) {
LOCK (&ctx->lock);
{
ctx->size += delta;
@@ -1860,7 +1860,7 @@ quota_truncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
goto out;
}
- delta = prebuf->ia_size - postbuf->ia_size;
+ delta = postbuf->ia_size - prebuf->ia_size;
quota_update_size (this, local->loc.inode, NULL, 0, delta);
@@ -1936,7 +1936,7 @@ quota_ftruncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
goto out;
}
- delta = prebuf->ia_size - postbuf->ia_size;
+ delta = postbuf->ia_size - prebuf->ia_size;
quota_update_size (this, local->loc.inode, NULL, 0, delta);