• Nick Piggin's avatar
    fix truncate inode time modification breakage · af5a30d8
    Nick Piggin authored
    mtime and ctime should be changed only if the file size has actually
    changed. Patches changing ext2 and tmpfs from vmtruncate to new truncate
    sequence has caused regressions where they always update timestamps.
    
    There is some strange cases in POSIX where truncate(2) must not update
    times unless the size has acutally changed, see 6e656be8.
    
    This area is all still rather buggy in different ways in a lot of
    filesystems and needs a cleanup and audit (ideally the vfs will provide
    a simple attribute or call to direct all filesystems exactly which
    attributes to change). But coming up with the best solution will take a
    while and is not appropriate for rc anyway.
    
    So fix recent regression for now.
    Signed-off-by: default avatarNick Piggin <npiggin@suse.de>
    Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    af5a30d8
inode.c 45 KB