From: Al Viro <viro@ZenIV.linux.org.uk>
To: Robert White <rwhite@pobox.com>
Cc: cwillu <cwillu@cwillu.com>, linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: General Question: ctime, mtime, and xattrs
Date: Sat, 6 Dec 2014 02:35:17 +0000 [thread overview]
Message-ID: <20141206023517.GA22149@ZenIV.linux.org.uk> (raw)
In-Reply-To: <54823FBA.9000707@pobox.com>
On Fri, Dec 05, 2014 at 03:28:58PM -0800, Robert White wrote:
> Ah...
>
> I've been thinking "ctime" is/was (still) "create time". It seems
> that somewhere in the last couple decades it became "change time";
> Or that I picked up that incorrect "create time" idea back in the
> UNIX Sys V R 3 days and just never had cause to think about it
> again...
v7 is the point where the third timestamp has first appeared (v6 has
only two - access and update). And their stat(2) says this:
st_atime is the file was last read. For reasons of efficiency, it is
not set when a directory is searched, although this would be more logi‐
cal. st_mtime is the time the file was last written or created. It is
not set by changes of owner, group, link count, or mode. st_ctime is
set both both by writing and changing the i-node.
FWIW, their /usr/sys/sys/sys4.c has
chmod()
{
register struct inode *ip;
register struct a {
char *fname;
int fmode;
} *uap;
uap = (struct a *)u.u_ap;
if ((ip = owner()) == NULL)
return;
ip->i_mode &= ~07777;
if (u.u_uid)
uap->fmode &= ~ISVTX;
ip->i_mode |= uap->fmode&07777;
ip->i_flag |= ICHG;
if (ip->i_flag&ITEXT && (ip->i_mode&ISVTX)==0)
xrele(ip);
iput(ip);
}
and /usr/sys/sys/iget.c has, in the end of iupdat() (called on the final
iput(), as well as on stat(2) and several other paths), this:
if(ip->i_flag&IACC)
dp->di_atime = *ta;
if(ip->i_flag&IUPD)
dp->di_mtime = *tm;
if(ip->i_flag&ICHG)
dp->di_ctime = time;
ip->i_flag &= ~(IUPD|IACC|ICHG);
(ta and tm are both equal to &time in that call chain). IOW, chmod(2)
definitely sets ctime.
IOW, ctime has never been "create time"; it's "change time" and it had been
that way since its introduction.
prev parent reply other threads:[~2014-12-06 2:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-05 22:08 General Question: ctime, mtime, and xattrs Robert White
[not found] ` <CAE5mzvgrdYSNWSWLrnmHMz2fSgPSJV_ocYr_ZSBGPwLWBshH-g@mail.gmail.com>
2014-12-05 23:28 ` Robert White
2014-12-06 1:39 ` Chris Samuel
2014-12-06 2:35 ` Al Viro [this message]
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=20141206023517.GA22149@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=cwillu@cwillu.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=rwhite@pobox.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.