diff options
author | kib <kib@FreeBSD.org> | 2007-03-14 08:50:27 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2007-03-14 08:50:27 +0000 |
commit | 104c10948a5e6aa98517e0c5c46c61b447b646ff (patch) | |
tree | 7db7d4c558da296734ed1ca8304f2262e0adab79 | |
parent | 5db0b75a187fc8f1c82bcb59428039a2145a66f8 (diff) | |
download | FreeBSD-src-104c10948a5e6aa98517e0c5c46c61b447b646ff.zip FreeBSD-src-104c10948a5e6aa98517e0c5c46c61b447b646ff.tar.gz |
Call getinoquota() before allocating new block for the directory to properly
account for block allocation.
Tested by: Peter Holm
Reviewed by: tegge
Approved by: re (kensmith)
-rw-r--r-- | sys/ufs/ufs/ufs_lookup.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index 1155817..7836659 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ffs_broken_fixme.h" #include "opt_ufs.h" +#include "opt_quota.h" #include <sys/param.h> #include <sys/systm.h> @@ -723,6 +724,13 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp) flags = BA_CLRBUF; if (!DOINGSOFTDEP(dvp) && !DOINGASYNC(dvp)) flags |= IO_SYNC; +#ifdef QUOTA + if ((error = getinoquota(dp)) != 0) { + if (DOINGSOFTDEP(dvp) && newdirbp != NULL) + bdwrite(newdirbp); + return (error); + } +#endif if ((error = UFS_BALLOC(dvp, (off_t)dp->i_offset, DIRBLKSIZ, cr, flags, &bp)) != 0) { if (DOINGSOFTDEP(dvp) && newdirbp != NULL) |