futimens and utimensat vs birthtime

From: Julian Elischer <julian_at_freebsd.org>
Date: Fri, 14 Aug 2015 22:46:10 +0800
So, currently the method of setting birthtime on a file is an awkward 
combination of tricks.
These break down in a number of situations, but the one I'm 
specifically interested in is as follows:

windows robocopy running through samba, onto a ZFS filesystem. (may 
happen for UFS2 as well.)

In order to mark a file as 'incomplete' during transfer, windows sets 
the modification time to Jan 1, 1980.
This triggers code in our system to set the birthtime to Jan 1 1980.
it then, on completion of the file sets the modification and birth 
times to the correct values.
This fails becasue you can not make a birthtime later than what it is 
already set to.

As the Man page for utimensat() says:
"Ideally a new system call will be added that allows the setting of 
all three times at once."

I would like to implement this call. but would like input as to it's 
nature.
The code inside the system would already appear to support handling 
three elements, though it needs some scrutiny,
so all that is needed is a system call with the ability to set the 
birthtime directly.

Whether it should take the form of the existing calls but expecting 
three items is up for discussion.
Maybe teh addition of a flags argument to specify which items are 
present and which to set.

ideas?

Julian
Received on Fri Aug 14 2015 - 12:46:27 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:59 UTC