From owner-freebsd-current Fri Feb 5 23:47:12 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id XAA06883 for freebsd-current-outgoing; Fri, 5 Feb 1999 23:47:12 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from apollo.backplane.com (apollo.backplane.com [209.157.86.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA06869 for ; Fri, 5 Feb 1999 23:47:11 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.9.2/8.9.1) id XAA07130; Fri, 5 Feb 1999 23:47:10 -0800 (PST) (envelope-from dillon) Date: Fri, 5 Feb 1999 23:47:10 -0800 (PST) From: Matthew Dillon Message-Id: <199902060747.XAA07130@apollo.backplane.com> To: freebsd-current@FreeBSD.ORG Subject: nfs hack to nfs_rename() committed Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Well, I was able to successfully 'make buildworld' and 'make installworld' on an NFS-V3 mounted / and /usr with this patch in place, so I am going to commit it to -4.x in liu of an NFS hacker figuring out what exactly was going on with delayed-write buffers. I think it's pretty important that we commit a fix to -3.x too -- either this patch, or the 'correct' fix depending on what the NFS gurus come up with. I don't think this particular patch will fix the vrele ref count bug reported today, but it should fix the problem I reported in regards to make installworld and it *might* have an impact on the dirty-buffer- panic-on-shutdown problem. -Matt Matthew Dillon Index: nfs_vnops.c =================================================================== RCS file: /home/ncvs/src/sys/nfs/nfs_vnops.c,v retrieving revision 1.119 diff -u -r1.119 nfs_vnops.c --- nfs_vnops.c 1999/01/27 22:45:49 1.119 +++ nfs_vnops.c 1999/02/06 07:40:26 @@ -1567,6 +1567,19 @@ } /* + * We have to flush B_DELWRI data prior to renaming + * the file. If we don't, the delayed-write buffers + * can be flushed out later after the file has gone stale + * under NFSV3. NFSV2 does not have this problem because + * ( as far as I can tell ) it flushes dirty buffers more + * often. + */ + + VOP_FSYNC(fvp, fcnp->cn_cred, MNT_WAIT, fcnp->cn_proc); + if (tvp) + VOP_FSYNC(tvp, tcnp->cn_cred, MNT_WAIT, tcnp->cn_proc); + + /* * If the tvp exists and is in use, sillyrename it before doing the * rename of the new file over it. * XXX Can't sillyrename a directory. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message