mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Russell Miller <duskglow@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: NFS directory listing hang on write.
Date: Tue, 02 Dec 2008 19:21:55 -0500	[thread overview]
Message-ID: <1228263715.7852.80.camel@heimdal.trondhjem.org> (raw)
In-Reply-To: <4eea36270812021605s58f27857pda48fa3c5542affa@mail.gmail.com>

On Tue, 2008-12-02 at 16:05 -0800, Russell Miller wrote:
> Hi, all.  We're having some NFS problems here that I don't understand.
> 
> The arguments are standard.  wsize=32768,rsize=32768,tcp.  Nothing
> else out of the ordinary.  Test case is easy too:
> 
> mount a filesystem.
> cd into the directory.
> create a 1G file and background the creation, so 1G is being written
> into the directory.
> Then, try to ls the directory.
> 
> The ls will hang, sometimes for a few seconds, sometimes for the
> entire length of the write.  This happens on every NFS server I've
> tried, including an acopia, bluearc, onstor, and a generic linux box
> running on the other end.

That is known and expected behaviour. It is not a bug.

The reason is that your 'ls' is also trying to stat() the file, and so
the client has to flush out all those writes in order to ensure that the
mtime/ctime are posixly correct.
By this, I mean that POSIX requires the filesystem to update the
mtime/ctime every time you issue a write() call. In the case of NFS,
this update is actually done when the client sends the WRITE rpc call to
to the server. IOW: in order to ensure that your mtime/ctime doesn't
change after you've issued the stat() call, we actually need to flush
out those backgrounded writes and wait for them to complete.

Cheers
  Trond


      reply	other threads:[~2008-12-03  0:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-03  0:05 Russell Miller
2008-12-03  0:21 ` Trond Myklebust [this message]

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=1228263715.7852.80.camel@heimdal.trondhjem.org \
    --to=trond.myklebust@fys.uio.no \
    --cc=duskglow@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®