Date: Sat, 10 Aug 2019 23:03:24 +0000 (UTC) From: Kirk McKusick <mckusick@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350850 - in stable/12/sys/ufs: ffs ufs Message-ID: <201908102303.x7AN3OmM091308@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mckusick Date: Sat Aug 10 23:03:23 2019 New Revision: 350850 URL: https://svnweb.freebsd.org/changeset/base/350850 Log: MFC of 350490 Set FORCE in chk[id]q when returning inodes and blocks. Modified: stable/12/sys/ufs/ffs/ffs_inode.c stable/12/sys/ufs/ffs/ffs_softdep.c stable/12/sys/ufs/ufs/ufs_quota.c stable/12/sys/ufs/ufs/ufs_vnops.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/ufs/ffs/ffs_inode.c ============================================================================== --- stable/12/sys/ufs/ffs/ffs_inode.c Sat Aug 10 20:08:37 2019 (r350849) +++ stable/12/sys/ufs/ffs/ffs_inode.c Sat Aug 10 23:03:23 2019 (r350850) @@ -256,7 +256,7 @@ ffs_truncate(vp, length, flags, cred) if ((error = ffs_syncvnode(vp, MNT_WAIT, 0)) != 0) return (error); #ifdef QUOTA - (void) chkdq(ip, -extblocks, NOCRED, 0); + (void) chkdq(ip, -extblocks, NOCRED, FORCE); #endif vinvalbuf(vp, V_ALT, 0, 0); vn_pages_remove(vp, @@ -609,7 +609,7 @@ done: DIP_SET(ip, i_blocks, 0); ip->i_flag |= IN_CHANGE; #ifdef QUOTA - (void) chkdq(ip, -blocksreleased, NOCRED, 0); + (void) chkdq(ip, -blocksreleased, NOCRED, FORCE); #endif return (allerror); Modified: stable/12/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- stable/12/sys/ufs/ffs/ffs_softdep.c Sat Aug 10 20:08:37 2019 (r350849) +++ stable/12/sys/ufs/ffs/ffs_softdep.c Sat Aug 10 23:03:23 2019 (r350850) @@ -6670,7 +6670,7 @@ softdep_journal_freeblocks(ip, cred, length, flags) #ifdef QUOTA /* Reference the quotas in case the block count is wrong in the end. */ quotaref(vp, freeblks->fb_quota); - (void) chkdq(ip, -datablocks, NOCRED, 0); + (void) chkdq(ip, -datablocks, NOCRED, FORCE); #endif freeblks->fb_chkcnt = -datablocks; UFS_LOCK(ump); @@ -6932,7 +6932,7 @@ softdep_setup_freeblocks(ip, length, flags) #ifdef QUOTA /* Reference the quotas in case the block count is wrong in the end. */ quotaref(ITOV(ip), freeblks->fb_quota); - (void) chkdq(ip, -datablocks, NOCRED, 0); + (void) chkdq(ip, -datablocks, NOCRED, FORCE); #endif freeblks->fb_chkcnt = -datablocks; UFS_LOCK(ump); Modified: stable/12/sys/ufs/ufs/ufs_quota.c ============================================================================== --- stable/12/sys/ufs/ufs/ufs_quota.c Sat Aug 10 20:08:37 2019 (r350849) +++ stable/12/sys/ufs/ufs/ufs_quota.c Sat Aug 10 23:03:23 2019 (r350850) @@ -159,6 +159,7 @@ chkdq(struct inode *ip, ufs2_daddr_t change, struct uc struct vnode *vp = ITOV(ip); int i, error, warn, do_check; + MPASS(cred != NOCRED || (flags & FORCE) != 0); /* * Disk quotas must be turned off for system files. Currently * snapshot and quota files. @@ -311,6 +312,7 @@ chkiq(struct inode *ip, int change, struct ucred *cred struct dquot *dq; int i, error, warn, do_check; + MPASS(cred != NOCRED || (flags & FORCE) != 0); #ifdef DIAGNOSTIC if ((flags & CHOWN) == 0) chkdquot(ip); Modified: stable/12/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- stable/12/sys/ufs/ufs/ufs_vnops.c Sat Aug 10 20:08:37 2019 (r350849) +++ stable/12/sys/ufs/ufs/ufs_vnops.c Sat Aug 10 23:03:23 2019 (r350850) @@ -811,8 +811,8 @@ ufs_chown(vp, uid, gid, cred, td) ip->i_dquot[GRPQUOTA] = NODQUOT; } change = DIP(ip, i_blocks); - (void) chkdq(ip, -change, cred, CHOWN); - (void) chkiq(ip, -1, cred, CHOWN); + (void) chkdq(ip, -change, cred, CHOWN|FORCE); + (void) chkiq(ip, -1, cred, CHOWN|FORCE); for (i = 0; i < MAXQUOTAS; i++) { dqrele(vp, ip->i_dquot[i]); ip->i_dquot[i] = NODQUOT;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201908102303.x7AN3OmM091308>