[TUHS] When/how did ctime change from inode "creation" to "change" time?

Rob Pike robpike at gmail.com
Wed Mar 12 21:46:39 AEST 2025


Well, it's creation time right after the file is created. I mean that's
kind of a joke, but also possibly an explanation for the comment, if you
consider the mindset of the person writing the code at the time. Then they
worked on the code some more and things moved along.

In short, it could well be an honest, original mistake.

-rob


On Wed, Mar 12, 2025 at 10:43 PM 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.)
>
> It's because we were genuinely interested that I decided to ask on
> TUHS list.  Some of us *do* care about the Unix history.  :-)
>
>                                  - Ted
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.tuhs.org/pipermail/tuhs/attachments/20250312/9fc13804/attachment.htm>


More information about the TUHS mailing list