summaryrefslogtreecommitdiffstats
path: root/sys/ufs/ffs/ffs_softdep.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2007-02-23 20:23:35 +0000
committerbrian <brian@FreeBSD.org>2007-02-23 20:23:35 +0000
commitc3843b2ccaf121804fc5e9fb1a761e28fa284014 (patch)
tree2541f5718c270583410edef9c317d95fef4526c0 /sys/ufs/ffs/ffs_softdep.c
parentbaf2de77c9925014d03b440257fc14e32e996eaa (diff)
downloadFreeBSD-src-c3843b2ccaf121804fc5e9fb1a761e28fa284014.zip
FreeBSD-src-c3843b2ccaf121804fc5e9fb1a761e28fa284014.tar.gz
Account for di_blocks allocations when IN_SPACECOUNTED is set in an
inode's i_flag. It's possible that after ufs_infactive() calls softdep_releasefile(), i_nlink stays >0 for a considerable amount of time (> 60 seconds here). During this period, any ffs allocation routines that alter di_blocks must also account for the blocks in the filesystem's fs_pendingblocks value. This change fixes an eventual df/du discrepency that will happen as the result of fs_pendingblocks being reduced to <0. The only manifestation of this that people may recognise is the following message on boot: /somefs: update error: blocks -N files M at which point the negative pending block count is adjusted to zero. Reviewed by: tegge MFC after: 3 weeks
Diffstat (limited to 'sys/ufs/ffs/ffs_softdep.c')
-rw-r--r--sys/ufs/ffs/ffs_softdep.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index 4ae9980..6d13610 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -2229,7 +2229,7 @@ softdep_setup_freeblocks(ip, length, flags)
}
/*
* If the file was removed, then the space being freed was
- * accounted for then (see softdep_filereleased()). If the
+ * accounted for then (see softdep_releasefile()). If the
* file is merely being truncated, then we account for it now.
*/
if ((ip->i_flag & IN_SPACECOUNTED) == 0) {
@@ -2747,7 +2747,7 @@ handle_workitem_freeblocks(freeblks, flags)
if ((bn = freeblks->fb_iblks[level]) == 0)
continue;
if ((error = indir_trunc(freeblks, fsbtodb(fs, bn),
- level, baselbns[level], &blocksreleased)) == 0)
+ level, baselbns[level], &blocksreleased)) != 0)
allerror = error;
ffs_blkfree(ump, fs, freeblks->fb_devvp, bn,
fs->fs_bsize, freeblks->fb_previousinum);
@@ -3514,9 +3514,9 @@ softdep_releasefile(ip)
int extblocks;
if (ip->i_effnlink > 0)
- panic("softdep_filerelease: file still referenced");
+ panic("softdep_releasefile: file still referenced");
/*
- * We may be called several times as the real reference count
+ * We may be called several times as the on-disk link count
* drops to zero. We only want to account for the space once.
*/
if (ip->i_flag & IN_SPACECOUNTED)
OpenPOWER on IntegriCloud