Date: Tue, 3 Apr 2001 20:46:49 +0200 (CEST) From: bg@sics.se To: FreeBSD-gnats-submit@freebsd.org Cc: bg@sics.se Subject: misc/26323: Quota subsystem generates zero-length files Message-ID: <200104031846.f33IknH19740@bg.sics.se>
next in thread | raw e-mail | index | archive | help
>Number: 26323 >Category: misc >Synopsis: Quota system create zero-length files >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Apr 03 11:50:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Bjoern Groenvall >Release: FreeBSD 4.2-RELEASE i386 >Organization: SICS >Environment: Systems using the UFS quota subsystem. >Description: 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. >How-To-Repeat: >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++) { >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200104031846.f33IknH19740>