[dovecot-cvs] dovecot/src/plugins/quota quota-dict.c, 1.9.2.9, 1.9.2.10

tss at dovecot.org tss at dovecot.org
Tue Apr 3 07:44:32 EEST 2007


Update of /var/lib/cvs/dovecot/src/plugins/quota
In directory talvi:/tmp/cvs-serv7255

Modified Files:
      Tag: branch_1_0
	quota-dict.c 
Log Message:
Recalculate quota if it's negative.



Index: quota-dict.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/plugins/quota/quota-dict.c,v
retrieving revision 1.9.2.9
retrieving revision 1.9.2.10
diff -u -d -r1.9.2.9 -r1.9.2.10
--- quota-dict.c	14 Feb 2007 19:32:04 -0000	1.9.2.9
+++ quota-dict.c	3 Apr 2007 04:44:30 -0000	1.9.2.10
@@ -128,11 +128,15 @@
 	if (ret > 0) {
 		long long tmp;
 
-		/* don't break in case the quota value is negative. */
 		tmp = strtoll(value, NULL, 10);
-		*value_r = tmp < 0 ? 0 : tmp;
-		t_pop();
-		return 0;
+		if (tmp >= 0) {
+			*value_r = tmp;
+			t_pop();
+			return 0;
+		}
+		/* negative quota. recalculate it. we don't track expunges
+		   entirely correctly, so this can happen if two processes
+		   expunge at the same time. */
 	}
 	t_pop();
 



More information about the dovecot-cvs mailing list