lkml.org 
[lkml]   [2021]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] fs: Fix truncate never updates m/ctime
On Mon, Nov 15, 2021 at 07:00:18PM +0800, Jubin Zhong wrote:
> From: zhongjubin <zhongjubin@huawei.com>
>
> 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.

\
 
 \ /
  Last update: 2021-11-16 00:11    [W:0.053 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site