Subject: kern/7107: Panic: vinvalbuf: dirty bufs on LFS
To: None <gnats-bugs@gnats.netbsd.org>
From: None <minoura@netbsd.org>
List: netbsd-bugs
Date: 03/09/1999 01:12:21
>Number:         7107
>Category:       kern
>Synopsis:       panic: vinvalbuf: dirty bufs on LFS
>Confidential:   no
>Severity:       critical
>Priority:       low
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar  8 08:20:00 1999
>Last-Modified:
>Originator:     Minoura Makoto
>Organization:
Minoura Makoto <minoura@netbsd.org> or <minoura@kw.netlaputa.ne.jp>
>Release:        1.3.3
>Environment:
System: NetBSD dale 1.3.3 NetBSD 1.3.3 (DALE) #12: Mon Mar 8 00:37:04 JST 1999 root@dale:/usr/src/sys/arch/sparc/compile/DALE sparc


>Description:
	The panic message means that a dirty vnode is found on the freelist.
	This is caused in lfs_vflush() in lfs_segment.c, because
	although it is expected to flush the specified vnode,
	lfs_vflush sometimes remains that vnode dirty, since
	lfs_segwrite() does not flush all the dirty vnodes.
	The following patch extremely increases the stability and usability
	of LFS.
>How-To-Repeat:
	Write on a LFS directory, such as
	tar -C /somewhere/in/LFS -xzf /cdrom/NetBSD-1.3.3/source/sets/syssrc.tgz
>Fix:
	
--- /usr/src/sys/ufs/lfs/lfs_segment.c.BAK	Fri Jun 13 17:59:51 1997
+++ /usr/src/sys/ufs/lfs/lfs_segment.c	Sun Mar  7 23:33:38 1999
@@ -121,8 +121,11 @@
 	struct segment *sp;
 
 	fs = VFSTOUFS(vp->v_mount)->um_lfs;
-	if (fs->lfs_nactive > MAX_ACTIVE)
-		return(lfs_segwrite(vp->v_mount, SEGM_SYNC|SEGM_CKP));
+	if (fs->lfs_nactive > MAX_ACTIVE) {
+		int r = lfs_segwrite(vp->v_mount, SEGM_SYNC|SEGM_CKP);
+		if (r != 0)
+			return (r);
+	}
 	lfs_seglock(fs, SEGM_SYNC);
 	sp = fs->lfs_sp;
 
>Audit-Trail:
>Unformatted: