Storage Quota Implementation
Assignment Attributes

The File Submission System Logo

Storage Quota Implementation


The submit system supports a storage quota for each assignment. The quota is enforced by submit.cgi which handles uploads of student work. To do this, it must know the amount of storage currently in used for the assignment. Rather than scanning the whole assignment directory tree to total the storage over all uploads, the system maintains a cache of the storage utilization in a disk file. Submit.cgi does the following:

There are a number of reasons why this procedure can allow actual disk usage to exceed the quota, the most obvious that any size submission can be added to an assignment which is not yet full. Maximum file sizes on submitted files limit the effect of this hole. This is somewhat aggravated by the fact that, by checking for the size then storing files, we create a race condition where a number of assignments arriving about the same time can all be stored, even though any one of them is large enough to pass the quota. There is also a minor issue that the incremental measurement of assignment space will miss growth of the root directory.

The upshot being that the storage limit isn't a very firm limit. It was intended to prevent the any particular assignment from using an unbounded amount of storage, and it will do that (unless you turn off size limits on individual files). Since the quota is generally a guess anyway, there seems little point is making a more expensive implementation in order to enforce it precisely.


To limit errors and for general paranoia, administrative operations on the assignment synchronize the storage cache. This is especially useful if you've made some changes to the assignment directory outside the submit system, perhaps using standard shell commands. This synchronization is done: