From: Andreas Dilger <adilger@clusterfs.com>
To: Steven French <sfrench@us.ibm.com>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: Why do we update ctime in generic_file_write?
Date: Tue, 21 Jan 2003 18:49:53 -0700 [thread overview]
Message-ID: <20030121184953.C1594@schatzie.adilger.int> (raw)
In-Reply-To: <OF3125BBE1.0013128A-ON87256CB6.00080511@us.ibm.com>; from sfrench@us.ibm.com on Tue, Jan 21, 2003 at 07:34:41PM -0600
On Jan 21, 2003 19:34 -0600, Steven French wrote:
> 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?
In 2.4, generic_file_write() calls update_inode_times(inode) which
updates both mtime and ctime if they are at least a second old.
In 2.5 it calls inode_update_time(inode, 1) which updates the mtime,
and the "1" indicates that the ctime should be updated (both are
updated only if the time is over a second old).
> 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)"
Good.
> 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.
Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/
next prev parent reply other threads:[~2003-01-22 1:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-22 1:34 Why do we update ctime in generic_file_write? Steven French
2003-01-22 1:49 ` Andreas Dilger [this message]
-- strict thread matches above, loose matches on Subject: below --
2003-01-22 1:00 Andreas Dilger
2003-01-22 13:31 ` Trond Myklebust
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030121184953.C1594@schatzie.adilger.int \
--to=adilger@clusterfs.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=sfrench@us.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).