Austin Group Defect Tracker

Aardvark Mark III


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0000489 [1003.1(2008)/Issue 7] System Interfaces Objection Error 2011-09-01 15:48 2012-02-14 10:36
Reporter eblake View Status public  
Assigned To ajosey
Priority normal Resolution Accepted  
Status Resolved  
Name Eric Blake
Organization Red Hat
User Reference ebb.truncate
Section truncate
Page Number 2136
Line Number 67570
Interp Status ---
Final Accepted Text
Summary 0000489: truncate should affect timestamps even for no size change
Description The wording for ftruncate() requires mtime and ctime updates on successful
completion, even when no change in file size occurs. However, truncate()
does not describe what happens when no size change occurs, which is
inconsistent with ftruncate(), and which is at odds with XBD 4.8 stating
that ctime updates occur even if the metadata written (in this case, the
file size) is identical to what it already was.
Desired Action At line 67570 [XSH truncate() DESCRIPTION], change the sentence:

"Upon successful completion, if the file size is changed, truncate( )
shall mark for update the last data modification and last file status
change timestamps of the file, and the S_ISUID and S_ISGID bits of the
file mode may be cleared."

to:

"Upon successful completion, truncate( ) shall mark for update the last
data modification and last file status change timestamps of the file,
and the S_ISUID and S_ISGID bits of the file mode may be cleared."
Tags tc2-2008
Attached Files

- Relationships
related to 0000485Interpretation Requiredajosey Unclear explanation about when last file status change timestamp shall be updated 

-  Notes
(0001127)
mkerrisk (reporter)
2012-02-14 10:36

While I agree with Eric about the strange inconsistency between truncate() and ftruncate(), the approved change *will* make Linux nonconformant.

On Linux, the ftruncate() system call always changes the file timestamps, even if the file size is not changed. However, Linux truncate() only changes the timestamps if the file size changes. (This observation is based on my reading of the kernel source and some userspace programs to test these details.) I haven't delved into the history, but quite possibly the Linux behavior occurs because the implementers looked closely at the specifications for these two functions.

I think some consideration should be given to existing Linux behavior before modifying the standard in a way that renders Linux nonconformant.

- Issue History
Date Modified Username Field Change
2011-09-01 15:48 eblake New Issue
2011-09-01 15:48 eblake Status New => Under Review
2011-09-01 15:48 eblake Assigned To => ajosey
2011-09-01 15:48 eblake Name => Eric Blake
2011-09-01 15:48 eblake Organization => Red Hat
2011-09-01 15:48 eblake User Reference => ebb.truncate
2011-09-01 15:48 eblake Section => truncate
2011-09-01 15:48 eblake Page Number => 2136
2011-09-01 15:48 eblake Line Number => 67570
2011-09-01 15:48 eblake Interp Status => ---
2011-09-01 15:50 eblake Relationship added related to 0000485
2011-09-08 15:32 nick Status Under Review => Resolved
2011-09-08 15:32 nick Resolution Open => Accepted
2011-09-08 15:32 nick Tag Attached: tc2-2008
2012-02-14 10:36 mkerrisk Note Added: 0001127


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker