changeset 12919:8fa544520413

quota: Set quota limit correctly (for code path that doesn't exist). quota_alloc() followed by quota_test/try_alloc() set the "quota left" limit wrong. But this is only a theoretical problem, because nothing actually calls quota_alloc() currently.
author Timo Sirainen <tss@iki.fi>
date Mon, 04 Apr 2011 23:07:37 +0300
parents 10ea7f598e11
children 618f610c7c67
files src/plugins/quota/quota.c
diffstat 1 files changed, 0 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/quota/quota.c	Mon Apr 04 19:20:20 2011 +0300
+++ b/src/plugins/quota/quota.c	Mon Apr 04 23:07:37 2011 +0300
@@ -958,7 +958,6 @@
 						 QUOTA_NAME_STORAGE_BYTES,
 						 &current, &limit);
 			if (ret > 0) {
-				current += ctx->bytes_used;
 				left = limit < current ? 0 : limit - current;
 				if (ctx->bytes_left > left)
 					ctx->bytes_left = left;
@@ -973,7 +972,6 @@
 						 QUOTA_NAME_MESSAGES,
 						 &current, &limit);
 			if (ret > 0) {
-				current += ctx->count_used;
 				left = limit < current ? 0 : limit - current;
 				if (ctx->count_left > left)
 					ctx->count_left = left;