From owner-svn-src-head@FreeBSD.ORG Wed Jun 15 18:05:08 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97176106564A; Wed, 15 Jun 2011 18:05:08 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7CB1A8FC14; Wed, 15 Jun 2011 18:05:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5FI58ql092270; Wed, 15 Jun 2011 18:05:08 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5FI58Hs092266; Wed, 15 Jun 2011 18:05:08 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201106151805.p5FI58Hs092266@svn.freebsd.org> From: Kirk McKusick Date: Wed, 15 Jun 2011 18:05:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223114 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2011 18:05:08 -0000 Author: mckusick Date: Wed Jun 15 18:05:08 2011 New Revision: 223114 URL: http://svn.freebsd.org/changeset/base/223114 Log: 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 Modified: head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_balloc.c head/sys/ufs/ffs/ffs_extern.h Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Wed Jun 15 15:24:21 2011 (r223113) +++ head/sys/ufs/ffs/ffs_alloc.c Wed Jun 15 18:05:08 2011 (r223114) @@ -116,7 +116,6 @@ static ufs2_daddr_t ffs_clusteralloc(str 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 @@ nospace: 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 @@ nospace: 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; Modified: head/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_balloc.c Wed Jun 15 15:24:21 2011 (r223113) +++ head/sys/ufs/ffs/ffs_balloc.c Wed Jun 15 18:05:08 2011 (r223114) @@ -105,6 +105,8 @@ ffs_balloc_ufs1(struct vnode *vp, off_t 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 @@ retry: 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 @@ retry: 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 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 @@ retry: 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 @@ retry: 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; Modified: head/sys/ufs/ffs/ffs_extern.h ============================================================================== --- head/sys/ufs/ffs/ffs_extern.h Wed Jun 15 15:24:21 2011 (r223113) +++ head/sys/ufs/ffs/ffs_extern.h Wed Jun 15 18:05:08 2011 (r223114) @@ -69,6 +69,7 @@ int ffs_flushfiles(struct mount *, int, 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);