atom feed21 messages in org.freebsd.freebsd-currentRe: Yet another patch to try for soft...
FromSent OnAttachments
Luoqi ChenSep 18, 1998 12:40 pm 
Julian ElischerSep 18, 1998 2:25 pm 
Don LewisSep 18, 1998 8:28 pm 
Brian FeldmanSep 19, 1998 1:41 pm 
Don LewisSep 21, 1998 5:51 am 
Luoqi ChenSep 21, 1998 9:12 am 
Luoqi ChenSep 21, 1998 9:23 am 
Don LewisSep 21, 1998 3:54 pm 
Brian FeldmanSep 21, 1998 4:22 pm 
Luoqi ChenSep 21, 1998 4:27 pm 
Don LewisSep 22, 1998 6:22 am 
Luoqi ChenSep 22, 1998 9:05 am 
Alfred PerlsteinSep 22, 1998 11:19 am 
Kirk McKusickSep 22, 1998 1:11 pm 
Kirk McKusickSep 22, 1998 1:50 pm 
Luoqi ChenSep 22, 1998 2:39 pm 
Luoqi ChenSep 22, 1998 3:11 pm 
Don LewisSep 22, 1998 5:57 pm 
Terry LambertSep 22, 1998 8:04 pm 
Terry LambertSep 22, 1998 8:28 pm 
Luoqi ChenSep 22, 1998 8:59 pm 
Subject:Re: Yet another patch to try for softupdates panic
From:Julian Elischer (jul@whistle.com)
Date:Sep 18, 1998 2:25:30 pm
List:org.freebsd.freebsd-current

I was just reading kirk's reply when I got this..

wannajob? :-)

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 majo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message

To Unsubscribe: send mail to majo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message