nfs delay causing broken files

Joe7 admin at
Fri Feb 6 11:37:48 PST 2009


So although it's likely that kernel hack would do it,
am I right that a wrapper script with open(...O_DIRECT) would do the job?

Basicly i'm creating an file with imagemagick and wanna place that on  
the nfs server.
So I assume if I create the file locally and copy over using a little  
script that uses open(.. O_DIRECT), it would just work?
Application is PHP+imagemagick binary thus pretty high level compared  
to this stuff, but please let me know if you agree!


Idézet (Rick Macklem <rmacklem at>):

> 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