Date: Fri, 5 Feb 1999 23:47:10 -0800 (PST) From: Matthew Dillon <dillon@apollo.backplane.com> To: freebsd-current@FreeBSD.ORG Subject: nfs hack to nfs_rename() committed Message-ID: <199902060747.XAA07130@apollo.backplane.com>
next in thread | raw e-mail | index | archive | help
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 <dillon@backplane.com> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199902060747.XAA07130>