nfs delay causing broken files

Rick Macklem rmacklem at uoguelph.ca
Fri Feb 6 11:03:47 PST 2009


Well, maybe not SOL if you are willing to hack the kernel sources. If you
change the following line in sys/nfsclient/nfs_bio.c as follows:
 	if (nfs_directio_enable && (ioflag & IO_DIRECT) && vp->v_type == VREG)
 		return nfs_directio_write(vp, uio, cred, ioflag);
to
 	if (nfs_directio_enable && vp->v_type == VREG)
 		return nfs_directio_write(vp, uio, cred, ioflag);

then all writes would be pushed to the server if nfs_directio_enable is
set non-zero by sysctl. (In other words, O_DIRECT would be set for all
opens on the NFS mounts.)

Ugly, but if it fixes your problem...rick
ps: I'm thinking that a mount option that does this might be useful?



More information about the freebsd-fs mailing list