Re: [PATCH] fs: Fix truncate never updates m/ctime

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

 



On Mon, Nov 15, 2021 at 07:00:18PM +0800, Jubin Zhong wrote:
> From: zhongjubin <zhongjubin@xxxxxxxxxx>
> 
> Syscall truncate() never updates m/ctime even if the file size is
> changed. However, this is incorrect according to man file:
> 
>   truncate (2):
>   If  the  size  changed, then the st_ctime and st_mtime fields
>   (respectively, time of last status change and time of last modification;
>   see stat(2)) for the file are updated, and the set-user-ID and
>   set-group-ID mode bits may be cleared.
> 
> Check file size before do_truncate() to fix this.

Please try to actually reproduce your alleged "bug".  And maybe also
look at the actual setattr implementations.  Hint: The XFS one even
has extensive comments.



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

  Powered by Linux