linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Why do we update ctime in generic_file_write?
@ 2003-01-22  1:34 Steven French
  2003-01-22  1:49 ` Andreas Dilger
  0 siblings, 1 reply; 4+ messages in thread
From: Steven French @ 2003-01-22  1:34 UTC (permalink / raw)
  To: linux-fsdevel





I saw the place in 2.4's generic_file_write in which
       inode->i_ctime = inode->i_mtime = CURRENT_TIME;
but I didn't see such a line in 2.5.56 or 2.5.58
Are you seeing it set somewhere else, less obvious,
in this path?   The writeups I found on st_ctime
would indicate that, as you noticed, it should not
be set there - POSIX spec said:
      "for changed file status, for example, chmod()"
and the man page on fstat says:
      "is changed by writing or setting inode information
      (ie owner, group, link count, mode)"

Andreas Dilger wrote:
>I was looking at the code in generic file write (both 2.4 and 2.5) and in
>both cases we update the ctime always.  My understanding here is that the
>mtime reflects the data modification time, while the ctime reflects the
>inode change time, so we should only be updating the ctime (at most) if
>the file size was increased, and not if we are overwriting data.


Steve French
Senior Software Engineer
Linux Technology Center - IBM Austin
phone: 512-838-2294
email: sfrench@us.ibm.com


^ permalink raw reply	[flat|nested] 4+ messages in thread
* Why do we update ctime in generic_file_write?
@ 2003-01-22  1:00 Andreas Dilger
  2003-01-22 13:31 ` Trond Myklebust
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Dilger @ 2003-01-22  1:00 UTC (permalink / raw)
  To: linux-fsdevel

I was looking at the code in generic file write (both 2.4 and 2.5) and in
both cases we update the ctime always.  My understanding here is that the
mtime reflects the data modification time, while the ctime reflects the
inode change time, so we should only be updating the ctime (at most) if
the file size was increased, and not if we are overwriting data.

Anyone have any good rationale for the current behaviour?

Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-01-22 13:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-22  1:34 Why do we update ctime in generic_file_write? Steven French
2003-01-22  1:49 ` Andreas Dilger
  -- strict thread matches above, loose matches on Subject: below --
2003-01-22  1:00 Andreas Dilger
2003-01-22 13:31 ` Trond Myklebust

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).