summaryrefslogtreecommitdiff
path: root/src/journal/journalctl.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2020-06-11 13:15:54 +0200
committerLennart Poettering <lennart@poettering.net>2020-06-25 09:28:22 +0200
commita4df1f0b9dca67c07167d51c17e21ea273dc14e3 (patch)
treec93ad491ce99b9598850091dfd1b9a66014695da /src/journal/journalctl.c
parent0523022d5b021db64238d7005f98ba31d6da8e92 (diff)
downloadsystemd-a4df1f0b9dca67c07167d51c17e21ea273dc14e3.tar.gz
journalctl: set and log about all fss file flags individually
Also, don#t complain about unsupported chattr support on backing fs beyond LOG_DEBUG.
Diffstat (limited to 'src/journal/journalctl.c')
-rw-r--r--src/journal/journalctl.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index 4864014a38..5a56a990f9 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -1848,11 +1848,19 @@ static int setup_keys(void) {
if (fd < 0)
return log_error_errno(fd, "Failed to open %s: %m", k);
- /* Enable secure remove, exclusion from dump, synchronous
- * writing and in-place updating */
- r = chattr_fd(fd, FS_SECRM_FL|FS_NODUMP_FL|FS_SYNC_FL|FS_NOCOW_FL, FS_SECRM_FL|FS_NODUMP_FL|FS_SYNC_FL|FS_NOCOW_FL, NULL);
- if (r < 0)
- log_warning_errno(r, "Failed to set file attributes: %m");
+ /* Enable secure remove, exclusion from dump, synchronous writing and in-place updating */
+ static const unsigned chattr_flags[] = {
+ FS_SECRM_FL,
+ FS_NODUMP_FL,
+ FS_SYNC_FL,
+ FS_NOCOW_FL,
+ };
+ for (size_t j = 0; j < ELEMENTSOF(chattr_flags); j++) {
+ r = chattr_fd(fd, chattr_flags[j], chattr_flags[j], NULL);
+ if (r < 0)
+ log_full_errno(ERRNO_IS_NOT_SUPPORTED(r) ? LOG_DEBUG : LOG_WARNING, r,
+ "Failed to set file attribute 0x%x: %m", chattr_flags[j]);
+ }
struct FSSHeader h = {
.signature = { 'K', 'S', 'H', 'H', 'R', 'H', 'L', 'P' },