From owner-freebsd-current Fri Sep 18 12:41:47 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA15804 for freebsd-current-outgoing; Fri, 18 Sep 1998 12:41:47 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from lor.watermarkgroup.com (lor.watermarkgroup.com [207.202.73.33]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA15798 for ; Fri, 18 Sep 1998 12:41:44 -0700 (PDT) (envelope-from luoqi@watermarkgroup.com) Received: (from luoqi@localhost) by lor.watermarkgroup.com (8.8.8/8.8.8) id PAA29792 for current@freebsd.org; Fri, 18 Sep 1998 15:41:19 -0400 (EDT) (envelope-from luoqi) Date: Fri, 18 Sep 1998 15:41:19 -0400 (EDT) From: Luoqi Chen Message-Id: <199809181941.PAA29792@lor.watermarkgroup.com> To: current@FreeBSD.ORG Subject: Yet another patch to try for softupdates panic Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG This patch could be the real cure for the `initiate_write_filepage' panic people were seeing during make -j# world. I have posted another patch about a week ago (in fact, I have committed it), but it turned out to be no more than a no-op (thanks to Bruce for pointing it out, it was an embarrassing silly mistake of mine). I certainly hope this patch will do its work: this patch should fix a race condition between directory truncation and file creation that could lead to the `initiate_write_filepage' panic. -lq PS. I know it is bad coding style. I'll make it look better if it's proven to work. Index: ffs_inode.c =================================================================== RCS file: /home/ncvs/src/sys/ufs/ffs/ffs_inode.c,v retrieving revision 1.47 diff -u -r1.47 ffs_inode.c --- ffs_inode.c 1998/09/15 14:45:28 1.47 +++ ffs_inode.c 1998/09/18 12:41:16 @@ -191,7 +191,7 @@ * rarely, we solve the problem by syncing the file * so that it will have no data structures left. */ - if ((error = VOP_FSYNC(ovp, cred, MNT_WAIT, + if ((error = VOP_FSYNC(ovp, cred, MNT_WAIT|0x80000000, p)) != 0) return (error); } else { Index: ffs_vnops.c =================================================================== RCS file: /home/ncvs/src/sys/ufs/ffs/ffs_vnops.c,v retrieving revision 1.51 diff -u -r1.51 ffs_vnops.c --- ffs_vnops.c 1998/09/07 11:50:19 1.51 +++ ffs_vnops.c 1998/09/18 16:13:01 @@ -126,8 +126,8 @@ struct buf *nbp; int s, error, passes, skipmeta; daddr_t lbn; + int istrunc = 0; - if (vp->v_type == VBLK) { lbn = INT_MAX; } else { @@ -137,6 +137,14 @@ } /* + * XXX hack to solve directory truncation problem + */ + if (ap->a_waitfor & 0x80000000) { + istrunc = 1; + ap->a_waitfor &= ~0x80000000; + } + + /* * Flush all dirty buffers associated with a vnode. */ passes = NIADDR; @@ -251,7 +259,7 @@ getmicrotime(&tv); if ((error = UFS_UPDATE(vp, &tv, &tv, ap->a_waitfor == MNT_WAIT)) != 0) return (error); - if (DOINGSOFTDEP(vp) && ap->a_waitfor == MNT_WAIT) + if (DOINGSOFTDEP(vp) && ap->a_waitfor == MNT_WAIT && !istrunc) error = softdep_fsync(vp); return (error); } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message