We have user quotas enabled on an amd64 system. The filesystem that has quotas enabled is mounted using the following options: (ufs, NFS exported, local, with quotas, journaled soft-updates) When we check the user quotas using repquota, we can see all user quota. If a user adds new files to the filesystem, repquota does indeed reflect this: the used block count goes up. However, if a user deletes files, the used block count does not go down. Running quotacheck recalculates the used block count, but afterwards the situation remains the same: used block count can increase, but does not decrease. The system has recently been upgraded from FreeBSD 8.2. Quotas were working fine when running 8.2. Fix: None How-To-Repeat: Enable quotas on a FreeBSD 9.0 system, on a partition with soft updates and soft update journaling enabled. Create files and the used block count increases. Delete some files and the used block count remains the same.
Found another problem report pointing to this (Thanks to koobs, Barnerd from IRC :-) ): - PR Kern/164734 Potential patch ( http://tips.paddyonline.net/index.php/FreeBSD_9.0_issues_with_Quota): diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 5b4b6b9..ed2db79 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ffs.h" +#include "opt_quota.h" #include "opt_ddb.h" /* @@ -6428,7 +6429,7 @@ softdep_setup_freeblocks(ip, length, flags) } #ifdef QUOTA /* Reference the quotas in case the block count is wrong in the end. */ - quotaref(vp, freeblks->fb_quota); + quotaref(ITOV(ip), freeblks->fb_quota); (void) chkdq(ip, -datablocks, NOCRED, 0); #endif freeblks->fb_chkcnt = -datablocks; Did not test it myself yet.
Hi, This is a follow-up to the problem report kern/166840: [quota] used block count increases but does not decrease. We tested the reported potential patch (http://tips.paddyonline.net/index.php/FreeBSD_9.0_issues_with_Quota <http://tips.paddyonline.net/index.php/FreeBSD_9.0_issues_with_Quota%29:>) on our 64bit Freebsd 9.0 system (running on VMWare ESXi). We applied the patch over 2 months ago and the system has been running without any problems since we applied the patch. Now the used block count increases and decreases correctly (the partition has quota, soft updates and softupdate journaling enabled). Environment: FreeBSD koala 9.0-RELEASE-p2 FreeBSD 9.0-RELEASE-p2 #0: Sat Jun 2 07:16:04 EEST 2012 hfvk@koala:/usr/obj/usr/src/sys/ELIZABETH amd64 - Antti
I'd like to ask for a status update on PR kern/166840. This bug affects a VPS used for shell accounts I administrate.
State Changed From-To: open->closed Fixed in r231091, merged to stable/9 as r231581.