]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/import/pull-raw.c
copy: don't synthesize a 'user.crtime_usec' xattr on copy unless explicitly requested
authorLennart Poettering <lennart@poettering.net>
Thu, 20 Dec 2018 15:01:57 +0000 (16:01 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 1 Mar 2019 13:11:07 +0000 (14:11 +0100)
commitadc6f43b148b097c846f63522876f0f1c91ea0c0
tree36f3310a1216afdea22c35bc91751bc8618f598a
parent2bef2582a140e4dbaa517c16befc445919f9b7c6
copy: don't synthesize a 'user.crtime_usec' xattr on copy unless explicitly requested

Previously, when we'd copy an individual file we'd synthesize a
user.crtime_usec xattr with the source's creation time if we can
determine it. As the creation/birth time was until recently not
queriable form userspace this effectively just propagated the same xattr
on the source to the same xattr on the destination. However, current
kernels now allow to query the birthtime using statx() and we do make
use of that now. Which means that suddenly we started synthesizing these
xattrs much more regularly.

Doing this actually does make sense, but only in very few cases:
not for the typical regular files we copy, but certainly when dealing
with disk images. Hence, let's keep this kind of propagation, but let's
make it a flag and default to off. Then turn it on whenever we deal with
disk images, and leave it off otherwise.

This is particularly relevant as overlayfs combining a real fs, and a
tmpfs on top will result in EOPNOTSUPP when it is attempted to open a
file with xattrs for writing, as tmpfs does not support xattrs, and
hence the copy-up cannot work. Hence, let's avoid synthesizing this
needlessly, to increase compat with overlayfs.
src/basic/copy.c
src/basic/copy.h
src/boot/bootctl.c
src/import/export-raw.c
src/import/import-raw.c
src/import/pull-raw.c
src/nspawn/nspawn.c
src/shared/machine-image.c