From owner-freebsd-current@FreeBSD.ORG Sun Sep 25 07:21:31 2005 Return-Path: X-Original-To: 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 0F35616A41F; Sun, 25 Sep 2005 07:21:31 +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 AC88243D48; Sun, 25 Sep 2005 07:21:30 +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 j8P7LD32092496; Sun, 25 Sep 2005 00:21:18 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <200509250721.j8P7LD32092496@gw.catspoiler.org> Date: Sun, 25 Sep 2005 00:21:13 -0700 (PDT) From: Don Lewis To: Tor.Egge@cvsup.no.freebsd.org In-Reply-To: <20050925.000932.74671878.Tor.Egge@cvsup.no.freebsd.org> MIME-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY="0-846930886-1127632882=:7432" Content-Transfer-Encoding: BINARY Cc: scottl@FreeBSD.org, current@FreeBSD.org, mckusick@FreeBSD.org Subject: Re: soft updates / background fsck directory link count bug 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: Sun, 25 Sep 2005 07:21:31 -0000 --0-846930886-1127632882=:7432 Content-Type: TEXT/plain; charset=us-ascii On 25 Sep, Tor Egge wrote: >> Relying on ufs_inactive() is probably the wrong thing to do because the >> ufs_inactive() call can be deferred indefinitely if another process >> holds a reference to the vnode. This is sufficient to cause background >> fsck to do the wrong thing even in the normal case. > >> I think the cleanest fix would be for handle_workitem_remove() to >> explicity call ffs_update(). > > Agreed. The enclosed patch does that. It works well for me in the testing that I have done. It also has the advantage of doing the dirrem rundown much more quickly than the unmodified code in your directory tree removal example. BTW, without this modification, your directory tree removal example will trigger a timeout in the syncer thread shutdown code if the system is immediately rebooted after the rm -r. --0-846930886-1127632882=:7432 Content-Type: TEXT/plain; name=softdep.diff6 Content-Disposition: attachment; filename=softdep.diff6 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); } --0-846930886-1127632882=:7432--