All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: Christoph Hellwig <hch@lst.de>,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH 2/2] nfs: update time staps on truncate
Date: Sun, 7 Sep 2014 18:57:03 +0200	[thread overview]
Message-ID: <20140907165703.GA21500@lst.de> (raw)
In-Reply-To: <CAHQdGtTe_mi_0N6hGApfrx_3TtL7=btWZNc9wd3hrkMdLRVfzQ@mail.gmail.com>

On Sun, Sep 07, 2014 at 12:41:28PM -0400, Trond Myklebust wrote:
> I'm still confused as to why we need this change to the client. In
> RFC5661, Section 18.30.4 there is wording to the effect that:
> 
>    Changing the size of a file with SETATTR indirectly changes the
>    time_modify and change attributes.  A client must account for this as
>    size changes can result in data deletion.
> 
> There is similar wording in RFC3530 and even in RFC1813 (see section
> 3.3.2). Without this sort of guarantee by the server, you could, for
> instance, get into nasty situations where the file changes, but the
> NFSv3 client doesn't detect it.
> 
> So basically, I interpret the spec is saying that we should be able to
> rely on the server figuring this out all by itself. I agree that we
> have the special corner case of ftruncate(), but the VFS is still
> setting the ATTR_CTIME|ATTR_MTIME flags for us in that case, right?

Yes.  Looks like the problem is on the server side indeed.  nfsd_setattr
adds a non-conditional ATTR_CTIME for all calls, but never adds ATTR_MTIME
for ATTR_SIZE requests.  I'll send a server patch instead.

[patch 1 in the series still seems worthwhile for the client, though]

  reply	other threads:[~2014-09-07 16:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-07 15:36 [PATCH 1/2] nfs: setattr can only change regular file sizes Christoph Hellwig
2014-09-07 15:36 ` [PATCH 2/2] nfs: update time staps on truncate Christoph Hellwig
2014-09-07 16:41   ` Trond Myklebust
2014-09-07 16:57     ` Christoph Hellwig [this message]
2014-09-07 20:59       ` 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=20140907165703.GA21500@lst.de \
    --to=hch@lst.de \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@primarydata.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.