From: Christoph Hellwig <hch@lst.de>
To: Jeff Layton <jlayton@poochiereds.net>
Cc: Christoph Hellwig <hch@lst.de>,
bfields@redhat.com, linux-nfs@vger.kernel.org,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] nfsd: special case truncates some more
Date: Mon, 23 Jan 2017 13:33:48 +0100 [thread overview]
Message-ID: <20170123123348.GA28102@lst.de> (raw)
In-Reply-To: <1485174116.2786.7.camel@poochiereds.net>
On Mon, Jan 23, 2017 at 07:21:56AM -0500, Jeff Layton wrote:
> So if you only have ATTR_SIZE then you're going to end up having to do
> another notify_change to update the ctime? Can we get away with just
> calling vfs_truncate when only ATTR_SIZE is set and skipping the
> notify_change to update the ctime?
We probably could, but there are some fine details there:
For truncate(2) Posix require us to not updated the time stamps when
truncating and already zero length file to 0, but for ftruncate(2) and
O_TRUNC we do have to update the mtime and ctime. The Linux VFS
communicates that difference by not setting ATTR_CTIME and ATTR_MTIME in
ia_valid for truncate(2), but expecting the fs to update them anyway.
(another reason for a proper truncate method to make this explicit).
I'll need to look at the exact NFS semantics in that area, but after
a bit of research I can probably come up with something that will work.
next prev parent reply other threads:[~2017-01-23 12:33 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-22 16:54 setattr ATTR_SIZE vs the rest Christoph Hellwig
2017-01-22 16:54 ` [PATCH] nfsd: special case truncates some more Christoph Hellwig
2017-01-23 12:21 ` Jeff Layton
2017-01-23 12:33 ` Christoph Hellwig [this message]
2017-01-23 15:36 ` Christoph Hellwig
2017-01-23 15:52 ` Jeff Layton
2017-01-23 16:05 ` Christoph Hellwig
2017-01-23 16:14 ` Jeff Layton
2017-01-23 16:20 ` Trond Myklebust
2017-01-23 16:26 ` hch
2017-01-23 17:25 ` Trond Myklebust
2017-01-23 17:38 ` hch
2017-01-23 17:42 ` Trond Myklebust
2017-01-24 16:25 ` J. Bruce Fields
2017-01-24 22:02 ` J. Bruce Fields
2017-01-23 16:58 ` setattr ATTR_SIZE vs the rest J. Bruce Fields
2017-01-24 7:52 ` Christoph Hellwig
-- strict thread matches above, loose matches on Subject: below --
2017-02-20 6:21 split setattr operations take 2 Christoph Hellwig
2017-02-20 6:21 ` [PATCH] nfsd: special case truncates some more Christoph Hellwig
2017-02-20 22:23 ` J. Bruce Fields
2017-02-21 15:07 ` Chuck Lever
2017-02-21 15:14 ` J. Bruce Fields
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=20170123123348.GA28102@lst.de \
--to=hch@lst.de \
--cc=bfields@redhat.com \
--cc=jlayton@poochiereds.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-nfs@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;
as well as URLs for NNTP newsgroup(s).