All of lore.kernel.org
 help / color / mirror / Atom feed
From: Trond Myklebust <trondmy@primarydata.com>
To: hch <hch@lst.de>, "jlayton@poochiereds.net" <jlayton@poochiereds.net>
Cc: "bfields@redhat.com" <bfields@redhat.com>,
	"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH] nfsd: special case truncates some more
Date: Mon, 23 Jan 2017 16:20:45 +0000	[thread overview]
Message-ID: <1485188442.41392.1.camel@primarydata.com> (raw)
In-Reply-To: <20170123160559.GA786@lst.de>

T24gTW9uLCAyMDE3LTAxLTIzIGF0IDE3OjA1ICswMTAwLCBDaHJpc3RvcGggSGVsbHdpZyB3cm90
ZToNCj4gT24gTW9uLCBKYW4gMjMsIDIwMTcgYXQgMTA6NTI6MDlBTSAtMDUwMCwgSmVmZiBMYXl0
b24gd3JvdGU6DQo+ID4gVG8gYmUgY2xlYXIsIHRoZSBjbGllbnQgaXMgcmVxdWVzdGluZyB0byBz
ZXQgdGhlIG10aW1lIHRvIGN1cnJlbnQNCj4gPiBzZXJ2ZXINCj4gPiB0aW1lIGFuZCBub3QgdG8g
YSBzcGVjaWZpYyBtdGltZSwgcmlnaHQ/DQo+IA0KPiBZZXMuwqDCoEFuZCBJIHRoaW5rIGl0J3Mg
bW9zdGx5IHRoZSBMaW51eCBjbGllbnQgYmVpbmcgbGF6eSAtDQo+IEFUVFJfTVRJTUUNCj4gaXMg
d2hhdCBpdCBnZXRzIGZyb20gdGhlIFZGUyBmb3IgYSB0cnVuY2F0ZSBvcGVyYXRpb24gKGJ1dCBu
b3QNCj4gZnRydW5hdGUsDQo+IHNvIHdlIHByb2JhYmx5IHdvbid0IHNlZSBpdCBvbiB0aGUgd2ly
ZSBpbiB0aGF0IGNhc2UsIGJ1dCBJIG5lZWQgdG8NCj4gdmVyaWZ5DQo+IHRoYXQgZmlyc3QpLsKg
wqBZZXQgYW5vdGhlciByZWFzb24gZm9yIC0+dHJ1bmNhdGUgOikNCj4gDQoNCk5vdGUgdGhhdCB0
aGUgUE9TSVggc3BlYyBzZWVtcyB0byBoYXZlIGNoYW5nZWQgcmVjZW50bHkuIFRoZSBjdXJyZW50
DQpzcGVjIGFwcGVhcnMgdG8gc3RhdGUgdGhhdCB3ZSBzaG91bGQgc2V0IHRoZSBtdGltZSBhbmQg
Y3RpbWUgKGFuZA0KY2hhbmdlIGF0dHJpYnV0ZSkgb24gc3VjY2VzcyBpbiBvcGVuKE9fVFJVTkMp
LCB0cnVuY2F0ZSgpIGFuZA0KZnRydW5jYXRlKCkuIEluIHByZXZpb3VzIGluY2FybmF0aW9ucyBv
ZiB0aGUgc3BlYywgdHJ1bmNhdGUoKSB3b3VsZA0Kb25seSBzZXQgdGhlIHRpbWUgaWYgdGhlIHNp
emUgd2FzIGNoYW5nZWQ6DQoNClNlZToNCmh0dHA6Ly9wdWJzLm9wZW5ncm91cC5vcmcvb25saW5l
cHVicy85Njk5OTE5Nzk5L2Z1bmN0aW9ucy9mdHJ1bmNhdGUuaHRtDQpsDQpodHRwOi8vcHVicy5v
cGVuZ3JvdXAub3JnL29ubGluZXB1YnMvOTY5OTkxOTc5OS9mdW5jdGlvbnMvdHJ1bmNhdGUuaHRt
bA0KaHR0cDovL3B1YnMub3Blbmdyb3VwLm9yZy9vbmxpbmVwdWJzLzk2OTk5MTk3OTkvZnVuY3Rp
b25zL29wZW4uaHRtbA0KDQotLSANClRyb25kIE15a2xlYnVzdA0KTGludXggTkZTIGNsaWVudCBt
YWludGFpbmVyLCBQcmltYXJ5RGF0YQ0KdHJvbmQubXlrbGVidXN0QHByaW1hcnlkYXRhLmNvbQ0K


WARNING: multiple messages have this Message-ID (diff)
From: Trond Myklebust <trondmy@primarydata.com>
To: hch <hch@lst.de>, "jlayton@poochiereds.net" <jlayton@poochiereds.net>
Cc: "bfields@redhat.com" <bfields@redhat.com>,
	"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH] nfsd: special case truncates some more
Date: Mon, 23 Jan 2017 16:20:45 +0000	[thread overview]
Message-ID: <1485188442.41392.1.camel@primarydata.com> (raw)
In-Reply-To: <20170123160559.GA786@lst.de>

On Mon, 2017-01-23 at 17:05 +0100, Christoph Hellwig wrote:
> On Mon, Jan 23, 2017 at 10:52:09AM -0500, Jeff Layton wrote:
> > To be clear, the client is requesting to set the mtime to current
> > server
> > time and not to a specific mtime, right?
> 
> Yes.  And I think it's mostly the Linux client being lazy -
> ATTR_MTIME
> is what it gets from the VFS for a truncate operation (but not
> ftrunate,
> so we probably won't see it on the wire in that case, but I need to
> verify
> that first).  Yet another reason for ->truncate :)
> 

Note that the POSIX spec seems to have changed recently. The current
spec appears to state that we should set the mtime and ctime (and
change attribute) on success in open(O_TRUNC), truncate() and
ftruncate(). In previous incarnations of the spec, truncate() would
only set the time if the size was changed:

See:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/ftruncate.htm
l
http://pubs.opengroup.org/onlinepubs/9699919799/functions/truncate.html
http://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html

-- 
Trond Myklebust
Linux NFS client maintainer, PrimaryData
trond.myklebust@primarydata.com

  parent reply	other threads:[~2017-01-23 16:20 UTC|newest]

Thread overview: 25+ 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
2017-01-23 15:36       ` Christoph Hellwig
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 [this message]
2017-01-23 16:20               ` Trond Myklebust
2017-01-23 16:26               ` hch
2017-01-23 17:25                 ` Trond Myklebust
2017-01-23 17:25                   ` Trond Myklebust
2017-01-23 17:38                   ` hch
2017-01-23 17:42                     ` Trond Myklebust
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=1485188442.41392.1.camel@primarydata.com \
    --to=trondmy@primarydata.com \
    --cc=bfields@redhat.com \
    --cc=hch@lst.de \
    --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 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.