From owner-freebsd-fs@FreeBSD.ORG Fri Feb 6 19:37:47 2009 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 605AB10657F5 for ; Fri, 6 Feb 2009 19:37:47 +0000 (UTC) (envelope-from admin@kedvenc.hu) Received: from site.hu (site.hu [212.92.23.185]) by mx1.freebsd.org (Postfix) with ESMTP id 1BC368FC22 for ; Fri, 6 Feb 2009 19:37:47 +0000 (UTC) (envelope-from admin@kedvenc.hu) Received: from www-data by site.hu with local (Exim 4.63 #1 (Debian)) id 1LVWWH-00015t-Nt; Fri, 06 Feb 2009 20:37:45 +0100 Received: from 92-249-229-208.pool.digikabel.hu (92-249-229-208.pool.digikabel.hu [92.249.229.208]) by www.site.hu (Horde MIME library) with HTTP; Fri, 06 Feb 2009 20:37:45 +0100 Message-ID: <20090206203745.57a035vq2so44ok0@www.site.hu> X-Priority: 3 (Normal) Date: Fri, 06 Feb 2009 20:37:45 +0100 From: Joe7 To: Rick Macklem References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-2; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Internet Messaging Program (IMP) H3 (4.1.4) Cc: freebsd-fs@freebsd.org Subject: Re: nfs delay causing broken files X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Feb 2009 19:37:48 -0000 Okay, 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 =20 the nfs server. So I assume if I create the file locally and copy over using a little =20 script that uses open(.. O_DIRECT), it would just work? Application is PHP+imagemagick binary thus pretty high level compared =20 to this stuff, but please let me know if you agree! Thanks Joe Id=E9zet (Rick Macklem ): > 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: > =09if (nfs_directio_enable && (ioflag & IO_DIRECT) && vp->v_type =3D=3D VR= EG) > =09=09return nfs_directio_write(vp, uio, cred, ioflag); > to > =09if (nfs_directio_enable && vp->v_type =3D=3D VREG) > =09=09return 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?