From owner-freebsd-current Sat Sep 19 13:45:33 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA23348 for freebsd-current-outgoing; Sat, 19 Sep 1998 13:45:33 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from zone.syracuse.net (zone.syracuse.net [205.232.47.17]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA23328 for ; Sat, 19 Sep 1998 13:45:29 -0700 (PDT) (envelope-from green@zone.syracuse.net) Received: from localhost (green@localhost) by zone.syracuse.net (8.8.8/8.8.7) with ESMTP id QAA09864; Sat, 19 Sep 1998 16:41:36 -0400 (EDT) Date: Sat, 19 Sep 1998 16:41:36 -0400 (EDT) From: Brian Feldman To: Luoqi Chen cc: current@FreeBSD.ORG Subject: Re: Yet another patch to try for softupdates panic In-Reply-To: <199809181941.PAA29792@lor.watermarkgroup.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Are you referring to $Id: ffs_inode.c,v 1.47 1998/09/15 14:45:28 luoqi Exp $ as the no-op change? That seems to be the only file here you've changed that relates to ufs, most recently (okay, nfs_*.c not relevant). And that patch seemed to have fixed my SoftUpdates crashes during a make -j4 world, so is that patch _really_ for nothing, or is this something else? -Brian Feldman On Fri, 18 Sep 1998, Luoqi Chen wrote: > 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 > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message