When a user comes close to his block quota limit, there are often many zero-length files created. This can be avoided be requiring a minimum number of blocks before inode creation is allowed to prooeed. Fix: Enable the following code using sysctl. --- ufs_quota.c 2000/11/18 11:49:53 1.1 +++ ufs_quota.c 2000/11/19 09:22:03 1.2 @@ -46,12 +46,17 @@ #include <sys/proc.h> #include <sys/vnode.h> #include <sys/mount.h> +#include <sys/sysctl.h> + #include <vm/vm_zone.h> #include <ufs/ufs/quota.h> #include <ufs/ufs/inode.h> #include <ufs/ufs/ufsmount.h> +static int quota_minblocks = 0; +SYSCTL_INT(_debug, OID_AUTO, quota_minblocks , CTLFLAG_RW, "a_minblocks, 0, ""); + static MALLOC_DEFINE(M_DQUOT, "UFS quota", "UFS quota entries"); /* @@ -275,6 +280,15 @@ error = chkiqchg(ip, change, cred, i); if (error) return (error); + /* + * If user has fewer than quota_minblocks + * left, disallow inode allocation. + */ + if (quota_minblocks > 0) { + error = chkdqchg(ip, quota_minblocks, cred, i); + if (error) + return (error); + } } } for (i = 0; i < MAXQUOTAS; i++) {
Responsible Changed From-To: freebsd-bugs->freebsd-fs Over to maintainer(s).
State Changed From-To: open->closed Described behaviour is a consequence of the design of the quita system and (probably) misbehaving applications. Proposed patch tries to implement the "disallow new inode allocations when too low number of blocks in user quota left", that is just silly, IMHO.