[Bug 272120] touch(1) -r modifies file's birthtime

[email protected]
Newsgroups gmane.os.freebsd.bugs
Message-ID <[email protected]/bugzilla/>
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=272120

--- Comment #5 from Alexey Dokuchaev <[email protected]> ---
(In reply to Simon Tettmar from comment #4)
> [VFS] deliberately sets va_birthtime to the requested mtime when the
> requested mtime is earlier than the current birthtime.
I've been thinking about this since when Mark had made his analysis in comment
#2, and could not come to peace with the rationale behind existing behavior.

> I cannot convince myself that having mtimes prior to birthtimes can ever
> be a good thing and so if no one objects I will look at updating touch(1)
> documentation to explain this behaviour.
I don't quite see why these timestamps should be interconnected at all.  Inode
birth time should be constant throughout the inode's life, due to the mere
definition of birth.  Non-constant birth time is semantically wrong. 
Modification time applies to file contents which has nothing to do with its
container's inode.

I guess I see the value of better describing current (bogus) behavior to reduce
user confusion, but I'll probably start patching my kernels to stop messing
with btimes after they were assigned.

-- 
You are receiving this mail because:
You are the assignee for the bug.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.