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@xxxxxxxxxxxxxxx ��.n��������+%������w��{.n�����{��w���jg��������ݢj����G�������j:+v���w�m������w�������h�����٥