From owner-freebsd-fs@FreeBSD.ORG Fri Feb 6 17:22:33 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 07052106566B for ; Fri, 6 Feb 2009 17:22:33 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from mailhub.cs.uoguelph.ca (mailhub.cs.uoguelph.ca [131.104.94.205]) by mx1.freebsd.org (Postfix) with ESMTP id A14508FC0C for ; Fri, 6 Feb 2009 17:22:32 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from muncher.cs.uoguelph.ca (muncher.cs.uoguelph.ca [131.104.91.102]) by mailhub.cs.uoguelph.ca (8.13.1/8.13.1) with ESMTP id n16HMThn025119; Fri, 6 Feb 2009 12:22:29 -0500 Received: from localhost (rmacklem@localhost) by muncher.cs.uoguelph.ca (8.11.7p3+Sun/8.11.6) with ESMTP id n16HQGo14774; Fri, 6 Feb 2009 12:26:16 -0500 (EST) X-Authentication-Warning: muncher.cs.uoguelph.ca: rmacklem owned process doing -bs Date: Fri, 6 Feb 2009 12:26:16 -0500 (EST) From: Rick Macklem X-X-Sender: rmacklem@muncher.cs.uoguelph.ca To: Joe7 In-Reply-To: Message-ID: References: <20090205212511.jrmipmazeo4o0c8w@www.site.hu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Scanned-By: MIMEDefang 2.63 on 131.104.94.205 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 17:22:33 -0000 On Fri, 6 Feb 2009, Rick Macklem wrote: [stuff snipped] > > If the recent writes need to be visible on other clients (and not just the > NFS server), you will also have to bypass the client side caching for > readers. This can be done by setting nfs_directio_enable to non-zero > using sysctl and opening the files with O_DIRECT. (I think setting > acregmax=0 as a mount option should achieve the same result, if you can't > add O_DIRECT to the apps.) Again, a big performance hit, but... > I know it's weird to reply to my own post, but I realized I should clarify that setting acregmax=0 will only achieve this approximately, based on the clock resolution used for the file's modify time. Setting acregmax=0 should disable client side attribute caching, such that the client always does a Getattr against the server. Then, if the mtime attribute for the file has changed since the client cached data, it will be purged. As such, this only works when the mtime has changed and that will be based upon clock resolution (and if the mtime got saved on the server's disk, for the case where the server has crashed/rebooted). Have a good weekend, rick