integer overflow at 2^32 in quota calculations
James Ralston
qralston+ml.info-cyrus at andrew.cmu.edu
Thu Jul 7 18:43:39 EDT 2005
On 2005-07-05 at 23:00+02 Sebastian Hagedorn <Hagedorn at uni-koeln.de> wrote:
> -- Paul Raines <raines at nmr.mgh.harvard.edu> is rumored to have mumbled on 5. Juli 2005 16:32:52 -0400 regarding Re: quotas not working a x86_64?:
>
> > On Tue, 5 Jul 2005, Ken Murchison wrote:
> >
> > > Its possible. I'm fairly certain that the code has been tested
> > > successfully on 64-bit Solaris. It seems odd that the quota
> > > file looks OK (which means that the code successfully handled
> > > writing the limit and usage), but fails a quota check.
> >
> > Actually I was setting the quota to '2000000000' which I thought
> > was 2GB, but I guess now was 2TB. THe system seemed to take it.
> > Is there some maximum for a quota in the system like 2GB no matter
> > what the setting is?
>
> We had this discussion a little while ago. In the current code the
> quota is set in KBs, but calculated in bytes. It's a 32 bit
> variable, so the limit is 2 GB ...
Actually, it's an unsigned 32-bit value, so the limit is 4GB:
https://bugzilla.andrew.cmu.edu/show_bug.cgi?id=2690
(Yes, we really do have users who are using more than 4GB of space.)
> this will be different in 2.3
Yes, Ken fixed it on 2004-08-09 in the cyrus-imapd-2_3 branch.
Ken, off the top of your head, can you think of any gotchas in
backporting your quota calculation fixes to 2.2? (I don't want to
wait until 2.3 for the fix, as this bug is currently biting us.)
Thanks,
--
James Ralston, Information Technology
Software Engineering Institute
Carnegie Mellon University, Pittsburgh, PA, USA
---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html
More information about the Info-cyrus
mailing list