summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-11-04 21:58:22 +0100
committerLennart Poettering <lennart@poettering.net>2021-11-12 22:13:48 +0100
commit8ccb69aef04b44dcc8245dc127a6b232df6d36b3 (patch)
treea8175ebd6f409093098dce02d15cff347b36a878
parentc3c50474d2dc31a84fb76c866cc6347808d54b2a (diff)
downloadsystemd-8ccb69aef04b44dcc8245dc127a6b232df6d36b3.tar.gz
homework: turn off compression for files backing LUKS volumes
We need random access read/write files, and compression sucks for that, hence disable it on the underlying files. Compression in the home directory might be desirable, but if so it should be done *inside* the home dir fs, not on the underlying fs.
-rw-r--r--src/home/homework-luks.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/home/homework-luks.c b/src/home/homework-luks.c
index 7aee82a980..ae101dd5bb 100644
--- a/src/home/homework-luks.c
+++ b/src/home/homework-luks.c
@@ -2155,8 +2155,8 @@ int home_create_luks(
setup->temporary_image_path = TAKE_PTR(t);
- r = chattr_fd(setup->image_fd, FS_NOCOW_FL, FS_NOCOW_FL, NULL);
- if (r < 0)
+ r = chattr_full(t, setup->image_fd, FS_NOCOW_FL|FS_NOCOMP_FL, FS_NOCOW_FL|FS_NOCOMP_FL, NULL, NULL, CHATTR_FALLBACK_BITWISE);
+ if (r < 0 && r != -ENOANO) /* ENOANO → some bits didn't work; which we skip logging about because chattr_full() already debug logs about those flags */
log_full_errno(ERRNO_IS_NOT_SUPPORTED(r) ? LOG_DEBUG : LOG_WARNING, r,
"Failed to set file attributes on %s, ignoring: %m", setup->temporary_image_path);