With the restructuring of the block reclaimation code, the notification

messages for a filesystem being out of space need to be moved so that
they do not print out until after a failed cleanup attempt.

Suggested by:	Jeff Roberson
This commit is contained in:
mckusick 2011-06-15 18:05:08 +00:00
parent e01ce27c8f
commit f433c75fa7
3 changed files with 28 additions and 4 deletions

View File

@ -116,7 +116,6 @@ static ufs2_daddr_t ffs_clusteralloc(struct inode *, u_int, ufs2_daddr_t, int,
static ino_t ffs_dirpref(struct inode *);
static ufs2_daddr_t ffs_fragextend(struct inode *, u_int, ufs2_daddr_t,
int, int);
static void ffs_fserr(struct fs *, ino_t, char *);
static ufs2_daddr_t ffs_hashalloc
(struct inode *, u_int, ufs2_daddr_t, int, int, allocfcn_t *);
static ufs2_daddr_t ffs_nodealloccg(struct inode *, u_int, ufs2_daddr_t, int,
@ -223,7 +222,7 @@ ffs_alloc(ip, lbn, bpref, size, flags, cred, bnp)
goto retry;
}
UFS_UNLOCK(ump);
if (ppsratecheck(&lastfail, &curfail, 1)) {
if (reclaimed > 0 && ppsratecheck(&lastfail, &curfail, 1)) {
ffs_fserr(fs, ip->i_number, "filesystem full");
uprintf("\n%s: write failed, filesystem is full\n",
fs->fs_fsmnt);
@ -432,7 +431,7 @@ ffs_realloccg(ip, lbprev, bprev, bpref, osize, nsize, flags, cred, bpp)
UFS_UNLOCK(ump);
if (bp)
brelse(bp);
if (ppsratecheck(&lastfail, &curfail, 1)) {
if (reclaimed > 0 && ppsratecheck(&lastfail, &curfail, 1)) {
ffs_fserr(fs, ip->i_number, "filesystem full");
uprintf("\n%s: write failed, filesystem is full\n",
fs->fs_fsmnt);
@ -2335,7 +2334,7 @@ ffs_mapsearch(fs, cgp, bpref, allocsiz)
* The form of the error message is:
* fs: error message
*/
static void
void
ffs_fserr(fs, inum, cp)
struct fs *fs;
ino_t inum;

View File

@ -105,6 +105,8 @@ ffs_balloc_ufs1(struct vnode *vp, off_t startoffset, int size,
ufs2_daddr_t *lbns_remfree, lbns[NIADDR + 1];
int unwindidx = -1;
int saved_inbdflush;
static struct timeval lastfail;
static int curfail;
int reclaimed;
ip = VTOI(vp);
@ -308,6 +310,11 @@ ffs_balloc_ufs1(struct vnode *vp, off_t startoffset, int size,
UFS_UNLOCK(ump);
goto retry;
}
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);
}
goto fail;
}
nb = newb;
@ -370,6 +377,11 @@ ffs_balloc_ufs1(struct vnode *vp, off_t startoffset, int size,
UFS_UNLOCK(ump);
goto retry;
}
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);
}
goto fail;
}
nb = newb;
@ -523,6 +535,8 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, int size,
int deallocated, osize, nsize, num, i, error;
int unwindidx = -1;
int saved_inbdflush;
static struct timeval lastfail;
static int curfail;
int reclaimed;
ip = VTOI(vp);
@ -836,6 +850,11 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, int size,
UFS_UNLOCK(ump);
goto retry;
}
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);
}
goto fail;
}
nb = newb;
@ -898,6 +917,11 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, int size,
UFS_UNLOCK(ump);
goto retry;
}
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);
}
goto fail;
}
nb = newb;

View File

@ -69,6 +69,7 @@ int ffs_flushfiles(struct mount *, int, struct thread *);
void ffs_fragacct(struct fs *, int, int32_t [], int);
int ffs_freefile(struct ufsmount *, struct fs *, struct vnode *, ino_t,
int, struct workhead *);
void ffs_fserr(struct fs *, ino_t, char *);
int ffs_isblock(struct fs *, u_char *, ufs1_daddr_t);
int ffs_isfreeblock(struct fs *, u_char *, ufs1_daddr_t);
void ffs_load_inode(struct buf *, struct inode *, struct fs *, ino_t);