linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miklos Szeredi <miklos@szeredi.hu>
To: Murphy Zhou <jencce.kernel@gmail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] fs/open.c: update {m,c}time for truncate
Date: Thu, 22 Aug 2019 15:03:26 +0200	[thread overview]
Message-ID: <CAJfpegvenW4yHks6r5zOSv_QWubeaB4zEF0dtiJ-H++pqGkLvg@mail.gmail.com> (raw)
In-Reply-To: <CAJfpegsJCpabQ7-pag9KU+NmXyrtJPauQi4poO9B9rZADLLvzg@mail.gmail.com>

On Thu, Aug 22, 2019 at 2:08 PM Miklos Szeredi <miklos@szeredi.hu> wrote:
>
> On Thu, Aug 22, 2019 at 9:33 AM Murphy Zhou <jencce.kernel@gmail.com> wrote:
> >
> > Just like what we do for ftruncate. (Why not)
> > Without this patch, cifs, sometimes NFS, fail to update timestamps
> > after truncate call.
>
> Digging through history:
>
> 4a30131e7dbb ("[PATCH] Fix some problems with truncate and mtime semantics.")
> 6e656be89999 ("[PATCH] ftruncate does not always update m/ctime")
>
> These are pretty old commits (>10years); has anything changed since
> then relative to the required semantics for truncate/ftruncate?

SUSv3/POSIX:2004:

   "Upon successful completion, if the file size is changed, this
function shall mark for update the st_ctime and st_mtime fields of the
file"

SUSv4/POSIX:2008:

   "Upon successful completion, truncate() shall mark for update the
last data modification and last file status change timestamps of the
file..."

Note the omission of the "if the file size is changed" condition...

Thanks,
Miklos

      reply	other threads:[~2019-08-22 13:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-22  7:33 [PATCH] fs/open.c: update {m,c}time for truncate Murphy Zhou
2019-08-22 12:08 ` Miklos Szeredi
2019-08-22 13:03   ` Miklos Szeredi [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=CAJfpegvenW4yHks6r5zOSv_QWubeaB4zEF0dtiJ-H++pqGkLvg@mail.gmail.com \
    --to=miklos@szeredi.hu \
    --cc=jencce.kernel@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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).