public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: David Laight <david.laight.linux@gmail.com>
Cc: "Artem S. Tashkinov" <aros@gmx.com>,
	linux-ext4@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: A syscall for changing birth time
Date: Tue, 11 Mar 2025 00:49:35 -0400	[thread overview]
Message-ID: <20250311044935.GD69932@mit.edu> (raw)
In-Reply-To: <20250310221243.0d5db7b3@pumpkin>

On Mon, Mar 10, 2025 at 10:12:43PM +0000, David Laight wrote:
> 
> I'm sure that hadn't used to be the case.
> But as some point the 'ctime' changed from something that was usually
> the file create time (for some definition of create) to a pretty useless
> time that is almost a waste of disk space.

ctime was "inode change time" in BSD 4.2, released in 1983.  So it's
been "change time" and not "creation time" for at least 42 years.

It might have been "creation time" back in the V7 Unix days, but I'd
gently suggest that after over four decades, arguing that we get to
change the semantics of an inode timestamp because we think know
better.... is not really justification for breaking backwards
compatibility.


I'd also note that trying to add "creation time" has all sorts of
interesting questions.  The way all pretty much all text editors work
when you save some file, at least if they are compotently implemented,
is to *NOT* truncate the existing file, and then rewrite it with the
new contents, but rather, to write the contents to "foo.c.new", then
rename "foo.c" to "foo.c.old", and then rename "foo.c.new" to "foo.c".

So pretty much all text editors that exist in Unix today will result
in the "creation time" to be pretty much the same "last moification
time" (within a few milliseconds; however long it takes to write the
file).

So without changing pretty much all userspace tools which rewrite
files, adding a "creation time" to Linux would be pretty much useless.
For example, what should git do when you run "git checkout"?  Should
itfigure out which git commit a file was first tracked in git, and use
that time stamp for the file's "creation time".  That would take a
fairly large effort for git, especially if it needs to be performant
--- and is it *really* all that useful to know when a file was first
created in the git history and to make it available as a file system
timestamp?

This really goes to my question of exactly how useful the file
creation time concept really is.  Perhaps that's why the developers at
the UC Berkley made ctime be "inode change time", I suspect when they
authored the BSD Fast File System 42 years ago.  Personally, while I
don't find "change time" to be all that useful --- I find "creation
time" an order of magnitude *more* useless.  :-)

					- Ted

  parent reply	other threads:[~2025-03-11  4:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-10  7:26 A syscall for changing birth time Artem S. Tashkinov
2025-03-10 13:58 ` Theodore Ts'o
2025-03-10 14:11   ` Artem S. Tashkinov
2025-03-10 15:37     ` Theodore Ts'o
2025-03-11 16:08       ` David Sterba
2025-03-11 21:14         ` Theodore Ts'o
2025-03-10 22:12   ` David Laight
2025-03-11  0:31     ` Al Viro
2025-03-11  4:49     ` Theodore Ts'o [this message]
2025-03-11  4:56       ` Al Viro
2025-03-11 17:07         ` Theodore Ts'o
2025-03-11 18:11           ` Al Viro
2025-03-11 20:01           ` David Laight

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=20250311044935.GD69932@mit.edu \
    --to=tytso@mit.edu \
    --cc=aros@gmx.com \
    --cc=david.laight.linux@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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