[TUHS] When/how did ctime change from inode "creation" to "change" time?
Henry Bent
henry.r.bent at gmail.com
Wed Mar 12 22:09:23 AEST 2025
On Wed, 12 Mar 2025 at 07:43, Theodore Ts'o <tytso at mit.edu> wrote:
> On Tue, Mar 11, 2025 at 09:38:39PM -0600, Warner Losh wrote:
> > So I think I have to disagree about what it means in v7, comments
> > notwithstanding.
> >
> > iupdat() has:
> > if(ip->i_flag&ICHG)
> > dp->di_ctime = time;
> >
> > ICHG is set in unlink(), chmod(), chown() and utime() (maybe a few
> others,
> > this was a quick peek).
> >
> > So even in v7, ctime means any changes to metadata / inode data. At least
> > for some definition of "any".
> >
> > Btw, it looks like this was named IUPD in v6 and did similar things. In
> v6
> > it is updated in iput when IUPD is set. But it looks like ctime and mtime
> > are folded together. So v7 is the first edition that has ctime and the
> code
> > implements any change to metadata from my reading.
>
> Yeah, Al Viro (the chief Pengiun VFS maintainer) had made a similar
> observation to yours. After I pointed out the Ritchie and Thompson
> Unix paper, Al also pointed out that comment could be found in the
> filsys.5 man page[1] dating from January 1979, also says "creation
> time" although that is an excerpt from the ino.h header file, the
> comment of which, as I said, persisted into 2BSD and 3BSD.
>
> [1]
> https://www.tuhs.org/cgi-bin/utree.pl?file=2.9BSD/usr/man/man5/filsys.5
>
> So this is why we were wondering whether if there was sometime when it
> actually *was* creation time, perhaps in between the v6 and v7
> releases, or whether it was always just a comment brain fart, which
> also managed to make it into a published paper and the filsys.5 man
> page, with no one caring enough to fix it until several years went by,
> and perhaps only at Berkeley. (I'm curious when if ever it got fixed
> in the AT&T sources, but I haven't gone and checked those sources
> yet.)
The comment in the source had not been changed as of SVR4; however between
SVR1 and SVR2 the manpage changed. For example, from looking at the
sources on the CSRG DVD:
S5_1/usr/man/u_man/man4/inode.4: time_t di_ctime; /\(** time
created \(**/
S5_2.0/usr/man/p_man/man4/inode.4: time_t di_ctime; /\(** time
of last file status change \(**/
and then again in SVR4:
S5_4.0/doc/MANPAGES/4/gen/inode_s5: time_t di_ctime; /\(** time
status last changed \(**/
All of the later Research versions (v[8-10]) have
time_t di_ctime; /* time created */
in that struct.
-Henry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.tuhs.org/pipermail/tuhs/attachments/20250312/148d3c2e/attachment.htm>
More information about the TUHS
mailing list