public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC 0/2] prototype: improve timestamp handling
@ 2025-04-16 14:43 Luca Di Maio
  2025-04-16 14:43 ` [PATCH RFC 1/2] xfs_proto: add origin also for directories, chardevs and symlinks Luca Di Maio
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Luca Di Maio @ 2025-04-16 14:43 UTC (permalink / raw)
  To: linux-xfs; +Cc: Luca Di Maio, dimitri.ledkov, smoser

Hi all,

This is an initial prototype to improve XFS's prototype file
functionality in scenarios where FS reproducibility is important.

Currently, when populating a filesystem with a prototype file, all generated inodes
receive timestamps set to the creation time rather than preserving timestamps from
their source files.

This patchset extends the protofile handling to preserve original timestamps (atime,
mtime, ctime) across all inode types. The implementation is split into two parts:

- First patch extends xfs_protofile.in to track origin path references for directories,
character devices and symlinks, similar to what's already implemented for regular files.

- Second patch leverages these references to read timestamp metadata from source files
and populate it into the newly created inodes during filesystem creation.

At the moment, the new `xfs_protofile` generates a file that results
invalid for older `mkfs.xfs` implementations. Also this new implementation
is not compatible with older prototype files.

I can imagine that new protofiles not working with older `mkfs.xfs`
might not be a problem, but what about backward compatibility?
I didn't find references on prototype file compatibility, is a change
like this unwanted?

If so, what do you think of a versioned support for prototype files?
I was thinking something on the lines of:

- xfs_protofile
  - if the new flag:
    - set the first comment accordingly
    - add the additional information
  - else act as old one

- proto.c
  - check if the doc starts with the comment `:origin-files enabled`
	(for example)
  - if so, this is the new format
  - else old format

Eager to know your thoughts and ideas
Thanks
L.

Luca Di Maio (2):
  xfs_proto: add origin also for directories, chardevs and symlinks
  proto: read origin also for directories, chardevs and symlinks. copy
    timestamps from origin.

 mkfs/proto.c          | 49 +++++++++++++++++++++++++++++++++++++++++++
 mkfs/xfs_protofile.in | 12 +++++------
 2 files changed, 55 insertions(+), 6 deletions(-)

--
2.49.0

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-04-23 14:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-16 14:43 [PATCH RFC 0/2] prototype: improve timestamp handling Luca Di Maio
2025-04-16 14:43 ` [PATCH RFC 1/2] xfs_proto: add origin also for directories, chardevs and symlinks Luca Di Maio
2025-04-16 16:07   ` Darrick J. Wong
2025-04-16 14:43 ` [PATCH RFC 2/2] proto: read origin also for directories, chardevs and symlinks. copy timestamps from origin Luca Di Maio
2025-04-16 16:07   ` Darrick J. Wong
2025-04-17 14:14     ` Luca Di Maio
2025-04-22  3:10 ` [PATCH RFC 0/2] prototype: improve timestamp handling Darrick J. Wong
2025-04-22  6:16   ` Luca Di Maio
2025-04-23 14:46     ` Darrick J. Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox