Re: [PATCH] fs/open.c: update {m,c}time for truncate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 22, 2019 at 2:08 PM Miklos Szeredi <miklos@xxxxxxxxxx> wrote:
>
> On Thu, Aug 22, 2019 at 9:33 AM Murphy Zhou <jencce.kernel@xxxxxxxxx> 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



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux