All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Siebenmann <cks@cs.toronto.edu>
To: Trond Myklebust <trondmy@hammerspace.com>
Cc: "chuck.lever@oracle.com" <chuck.lever@oracle.com>,
	"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	cks@cs.toronto.edu
Subject: Re: A NFS client partial file corruption problem in recent/current kernels
Date: Tue, 11 Sep 2018 17:39:13 -0400	[thread overview]
Message-ID: <20180911213913.ABE8B322562@apps1.cs.toronto.edu> (raw)
In-Reply-To: trondmy's message of Tue, 11 Sep 2018 21:25:48 -0000. <d5ffaf3fa306a6af744d9dfb67c7d13480446039.camel@hammerspace.com>

> This has nothing to do with mount options. Buffered reads of a file
> that is being written to over NFS without using locking is inherently
> unsafe. That always has been the case...
>
> Both writes and reads can be reordered by the RPC layer on both the
> client and the server, and they can be further reordered by the
> NFS layer on the server. In practice, this means that you can find
> yourself reading parts of the file that have not yet completed being
> written to, because, for example, a write that extended the file from
> offset 4096- 8191 completed before the write that was supposed to
> extend it from offset 0-4095 was processed by the server.

 Our issue also happens when the writes are done on the fileserver,
though, and they occur even if you allow plenty of time for the writes
to settle. I can run my test program in a mode where it explicitly waits
for me to tell it to continue, do the appending to the file on the
fileserver, 'sync' on the fileserver, wait five minutes, and the NFS
client will still see those zero bytes when it tries to read the new
data.

(To make sure the 'five minutes' bit wasn't hyperbole, I just tested
it.)

	- cks

  reply	other threads:[~2018-09-12  2:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-11 15:59 A NFS client partial file corruption problem in recent/current kernels Chris Siebenmann
2018-09-11 17:12 ` Trond Myklebust
2018-09-11 18:02   ` Chris Siebenmann
2018-09-11 20:00     ` Trond Myklebust
2018-09-11 20:38       ` Chris Siebenmann
2018-09-11 20:40       ` Chuck Lever
2018-09-11 20:47         ` Chris Siebenmann
2018-09-11 21:25           ` Trond Myklebust
2018-09-11 21:39             ` Chris Siebenmann [this message]
2018-09-11 22:12               ` Trond Myklebust
2018-09-11 23:45                 ` Chris Siebenmann
2018-09-12  2:19                   ` Trond Myklebust
2018-09-12  3:03                     ` Chris Siebenmann
2018-09-12 17:11                       ` Trond Myklebust
2018-09-11 20:56         ` Trond Myklebust

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180911213913.ABE8B322562@apps1.cs.toronto.edu \
    --to=cks@cs.toronto.edu \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trondmy@hammerspace.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.