Return-Path: linux-nfs-owner@vger.kernel.org Received: from mx1.redhat.com ([209.132.183.28]:57072 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752748AbbBZPgo (ORCPT ); Thu, 26 Feb 2015 10:36:44 -0500 Message-ID: <1424964994.640.0.camel@willson.usersys.redhat.com> Subject: Re: File Read Returns Non-existent Null Bytes From: Simo Sorce To: Trond Myklebust Cc: Chris Perl , Linux NFS Mailing List , Chris Perl Date: Thu, 26 Feb 2015 10:36:34 -0500 In-Reply-To: <1424964871.10136.6.camel@primarydata.com> References: <1424964150.13431.57.camel@willson.usersys.redhat.com> <1424964871.10136.6.camel@primarydata.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org List-ID: On Thu, 2015-02-26 at 10:34 -0500, Trond Myklebust wrote: > On Thu, 2015-02-26 at 10:22 -0500, Simo Sorce wrote: > > On Thu, 2015-02-26 at 09:10 -0500, Chris Perl wrote: > > > > However if you are asking us for an extensive list of "this is what I > > > > can expect if I ignore these rules", then I don't think you will find > > > > much traction. Such a list would be committing us to defining a model > > > > for "non-close-to-open" semantics, which isn't of interest to me at > > > > least, and I doubt anyone else is interested in committing to > > > > maintaining that. > > > > > > One more point on this. I wasn't really asking for a list of what I > > > can expect if I ignore the rules (although I think pointing out that > > > reading corrupt data from the cache is worth mentioning), I was asking > > > what the rules for close-to-open consistency were so I can follow > > > them. I now know one of them is that if a file is open for writing on > > > one client then it can't be read on another. Are there others? > > > > Is this a rule or a bug ? > > How does an application know that the file is open elsewhere for > > writing ? > > 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. Ok, I assume proper use of locking will address the situation and allow readers to get consistent data and not null bytes ? Simo. -- Simo Sorce * Red Hat, Inc * New York