Return-Path: linux-nfs-owner@vger.kernel.org Received: from mail-vc0-f169.google.com ([209.85.220.169]:46069 "EHLO mail-vc0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753643AbbBZXnj (ORCPT ); Thu, 26 Feb 2015 18:43:39 -0500 Received: by mail-vc0-f169.google.com with SMTP id kv19so5262655vcb.0 for ; Thu, 26 Feb 2015 15:43:38 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <1424964150.13431.57.camel@willson.usersys.redhat.com> <1424964871.10136.6.camel@primarydata.com> Date: Thu, 26 Feb 2015 18:43:38 -0500 Message-ID: Subject: Re: File Read Returns Non-existent Null Bytes From: Trond Myklebust To: Chris Perl Cc: Simo Sorce , Linux NFS Mailing List , Chris Perl Content-Type: text/plain; charset=UTF-8 Sender: linux-nfs-owner@vger.kernel.org List-ID: On Thu, Feb 26, 2015 at 11:00 AM, Chris Perl wrote: >> It is up to you to ensure that you don't set up such a situation, just >> like it is also your responsibility to ensure that you don't run 2 >> applications that do read-modify-writes to the same file on a regular >> POSIX filesystem. >> >> This is a rule that has worked just fine for the NFS community for more >> than 30 years. It isn't anything new that we're only adding to Linux. > > I'm not trying to be annoying and hope I'm not coming across as such. > > Given that I've used NFS for many years being blissfully unaware of > the close-to-open cache consistency requirement you've described (it > seems to work most of the time!), I'm generally curious if there are > other such rules I must follow or if the one we've been discussing is > the only such rule. The only other things that I can think of are: 1) Attributes are generally not immediately updated on clients. Even if you specify 'noac', there is no locking that can ensure size changes, for instance, are reflected well enough on the client to ensure perfect O_APPEND semantics. 2) Readdir results are unreliable when the directory is being updated on the server or on other clients. You should still be able to depend on O_EXCL file create semantics, though. 3) the lack of flock() type locks. We have to emulate them using byte range locks, which means that under NFS the fcntl() and flock() locks can and will conflict with one another. 4) file notifications generally do not work well, since there is no protocol support for that either -- Trond Myklebust Linux NFS client maintainer, PrimaryData trond.myklebust@primarydata.com