[Bugme-new] [Bug 6772] New: truncate() updates timestamps even if file size does not change

bugme-daemon at bugzilla.kernel.org bugme-daemon at bugzilla.kernel.org
Fri Jun 30 00:00:17 PDT 2006


http://bugzilla.kernel.org/show_bug.cgi?id=6772

           Summary: truncate() updates timestamps even if file size does not
                    change
    Kernel Version: 2.6.17
            Status: NEW
          Severity: normal
             Owner: xfs-masters at oss.sgi.com
         Submitter: michael.kerrisk at gmx.net


Most recent kernel where this bug did not occur: unknown
Distribution: SUSE 10.0
Hardware Environment: x86
Software Environment:
Problem Description:

POSIX requires that truncate() only change the ctime and mtime on the file if
the file size actually changes (see "man 3p truncate").  On ext2 and ext3, this
seems to work as required. 

However, ox XFS, truncate() changes the timestamps of the file even if the file
size remains unchanged.  This should not happen.

Steps to reproduce:

Something like the following can be used to test:
...

int main(int argc, char *argv[])
{
    if (truncate(argv[1], atoi(argv[2])) == -1) 
        perror("truncate")
}

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.



More information about the Bugme-new mailing list