[PANIC] ufs_dirbad: bad dir

Don Lewis truckman at FreeBSD.org
Tue Sep 27 12:23:36 PDT 2005


On 27 Sep, Robert Watson wrote:

> In the last week, on several occasions I've run into a situation where, 
> following a clean shutdown/reboot during a heavy build or tar operations, 
> the file system has come back up with minor corruption such that some 
> directory entries return EBADF, and fsck reports that the inodes were 
> partially cleared.  I've not yet reported it on a mailing list as I've 
> only seen it happen with a development kernel with extensive changes (our 
> audit development tree), and could be a property of those changes.  There 
> may or may not be a correlation to a case where the syncer gives up on 
> certain vnodes during the shutdown as a result of a reference leak of some 
> sort.  I'll keep an eye out for it happening on a stock kernel though.

I've seen the syncer thread shutdown timeout if I reboot immediately
after removing a large directory tree.  Tor Egge posted this patch to
ffs_softdep.c on Sunday which seems to fix this as a side effect.

Index: sys/ufs/ffs/ffs_softdep.c
===================================================================
RCS file: /home/ncvs/src/sys/ufs/ffs/ffs_softdep.c,v
retrieving revision 1.184
diff -u -r1.184 ffs_softdep.c
--- sys/ufs/ffs/ffs_softdep.c	5 Sep 2005 22:14:33 -0000	1.184
+++ sys/ufs/ffs/ffs_softdep.c	24 Sep 2005 22:09:50 -0000
@@ -3477,6 +3477,8 @@
 	}
 	WORKLIST_INSERT(&inodedep->id_inowait, &dirrem->dm_list);
 	FREE_LOCK(&lk);
+	ip->i_flag |= IN_CHANGE;
+	ffs_update(vp, 0);
 	vput(vp);
 }



More information about the freebsd-current mailing list