summaryrefslogtreecommitdiffstats
path: root/src/tmpfiles
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-07-22 22:02:14 +0200
committerLennart Poettering <lennart@poettering.net>2015-07-22 22:02:14 +0200
commitad75a97f7d86ddbc1b8521ae084862013c1713b0 (patch)
tree2558b448afaf78a620f0890addd76d11539104a9 /src/tmpfiles
parentMerge pull request #660 from michich/in-set (diff)
downloadsystemd-ad75a97f7d86ddbc1b8521ae084862013c1713b0.tar.xz
systemd-ad75a97f7d86ddbc1b8521ae084862013c1713b0.zip
tmpfiles: downgrade errors when a file system does not support file attributes
This downgrades errors from setting file attributes via tmpfiles to warnings and makes them non-fatal. Also, as a special case, if a file system does not support file attributes at all, then the message is downgraded to debug, so that it is not seen at all. With this change reiserfs should not see any messages at all anymore (since it apparently does not implement file attributes at all), but XFS will still get a warning but no failure. The warning is something the XFS kernel folks should fix though, by adjusting their file attributes behaviour to be identical to ext234's. Fixes #560.
Diffstat (limited to 'src/tmpfiles')
-rw-r--r--src/tmpfiles/tmpfiles.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index 42f757c4b7..271984b5a8 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -955,9 +955,10 @@ static int path_set_attribute(Item *item, const char *path) {
r = chattr_fd(fd, f, item->attribute_mask);
if (r < 0)
- return log_error_errno(r,
- "Cannot set file attribute for '%s', value=0x%08x, mask=0x%08x: %m",
- path, item->attribute_value, item->attribute_mask);
+ log_full_errno(r == -ENOTTY ? LOG_DEBUG : LOG_WARNING,
+ r,
+ "Cannot set file attribute for '%s', value=0x%08x, mask=0x%08x: %m",
+ path, item->attribute_value, item->attribute_mask);
return 0;
}