From owner-freebsd-current@FreeBSD.ORG Tue Sep 27 19:23:36 2005 Return-Path: X-Original-To: freebsd-current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 84D1716A41F; Tue, 27 Sep 2005 19:23:36 +0000 (GMT) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id AAC7143D48; Tue, 27 Sep 2005 19:23:35 +0000 (GMT) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id j8RJNNhF099503; Tue, 27 Sep 2005 12:23:27 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <200509271923.j8RJNNhF099503@gw.catspoiler.org> Date: Tue, 27 Sep 2005 12:23:23 -0700 (PDT) From: Don Lewis To: rwatson@FreeBSD.org In-Reply-To: <20050927155001.I34322@fledge.watson.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: freebsd-current@FreeBSD.org, obrien@FreeBSD.org, kris@obsecurity.org Subject: Re: [PANIC] ufs_dirbad: bad dir X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2005 19:23:36 -0000 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); }