diff options
author | ps <ps@FreeBSD.org> | 2005-10-31 20:33:28 +0000 |
---|---|---|
committer | ps <ps@FreeBSD.org> | 2005-10-31 20:33:28 +0000 |
commit | 48828711ca50e680ee60841ad56424a1c6b47ea0 (patch) | |
tree | 9975b588e8a5a35d45e63794d1866ba521d1e804 /sys | |
parent | 4094ae5452f34895c4e4d791ec7612fd08776471 (diff) | |
download | FreeBSD-src-48828711ca50e680ee60841ad56424a1c6b47ea0.zip FreeBSD-src-48828711ca50e680ee60841ad56424a1c6b47ea0.tar.gz |
Rate limit filesystem full and out of inodes messages to once a
second.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/ufs/ffs/ffs_alloc.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index dc0f263..af4d913 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -140,6 +140,8 @@ ffs_alloc(ip, lbn, bpref, size, cred, bnp) struct ufsmount *ump; ufs2_daddr_t bno; int cg, reclaimed; + static struct timeval lastfail; + static int curfail; #ifdef QUOTA int error; #endif @@ -200,8 +202,11 @@ nospace: goto retry; } UFS_UNLOCK(ump); - ffs_fserr(fs, ip->i_number, "filesystem full"); - uprintf("\n%s: write failed, filesystem is full\n", fs->fs_fsmnt); + if (ppsratecheck(&lastfail, &curfail, 1)) { + ffs_fserr(fs, ip->i_number, "filesystem full"); + uprintf("\n%s: write failed, filesystem is full\n", + fs->fs_fsmnt); + } return (ENOSPC); } @@ -229,6 +234,8 @@ ffs_realloccg(ip, lbprev, bprev, bpref, osize, nsize, cred, bpp) struct ufsmount *ump; int cg, request, error, reclaimed; ufs2_daddr_t bno; + static struct timeval lastfail; + static int curfail; *bpp = 0; vp = ITOV(ip); @@ -398,8 +405,11 @@ nospace: UFS_UNLOCK(ump); if (bp) brelse(bp); - ffs_fserr(fs, ip->i_number, "filesystem full"); - uprintf("\n%s: write failed, filesystem is full\n", fs->fs_fsmnt); + if (ppsratecheck(&lastfail, &curfail, 1)) { + ffs_fserr(fs, ip->i_number, "filesystem full"); + uprintf("\n%s: write failed, filesystem is full\n", + fs->fs_fsmnt); + } return (ENOSPC); } @@ -889,6 +899,8 @@ ffs_valloc(pvp, mode, cred, vpp) struct ufsmount *ump; ino_t ino, ipref; int cg, error; + static struct timeval lastfail; + static int curfail; *vpp = NULL; pip = VTOI(pvp); @@ -960,8 +972,11 @@ ffs_valloc(pvp, mode, cred, vpp) return (0); noinodes: UFS_UNLOCK(ump); - ffs_fserr(fs, pip->i_number, "out of inodes"); - uprintf("\n%s: create/symlink failed, no inodes free\n", fs->fs_fsmnt); + if (ppsratecheck(&lastfail, &curfail, 1)) { + ffs_fserr(fs, pip->i_number, "out of inodes"); + uprintf("\n%s: create/symlink failed, no inodes free\n", + fs->fs_fsmnt); + } return (ENOSPC); } |