d243c14
From 983c520982b548c9bb8f2689a93f2fb35c54c392 Mon Sep 17 00:00:00 2001
d243c14
From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= <crrodriguez@opensuse.org>
d243c14
Date: Sun, 1 Mar 2015 21:13:10 -0300
d243c14
Subject: [PATCH] journal: fix Inappropriate ioctl for device on ext4
d243c14
d243c14
Logs constantly show
d243c14
d243c14
systemd-journald[395]: Failed to set file attributes: Inappropriate ioctl for device
d243c14
d243c14
This is because ext4 does not support FS_NOCOW_FL.
d243c14
d243c14
[zj: fold into one conditional as suggested on the ML and
d243c14
     fix (preexisting) r/errno confusion in error message.]
d243c14
d243c14
(cherry picked from commit 65eae3b76243d2dfd869f8c43b787575f7b4b994)
d243c14
---
d243c14
 src/journal/journal-file.c | 4 ++--
d243c14
 1 file changed, 2 insertions(+), 2 deletions(-)
d243c14
d243c14
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
d243c14
index 2845e05ce0..0f28718b0e 100644
d243c14
--- a/src/journal/journal-file.c
d243c14
+++ b/src/journal/journal-file.c
d243c14
@@ -2611,8 +2611,8 @@ int journal_file_open(
d243c14
                  * shouldn't be too bad, given that we do our own
d243c14
                  * checksumming). */
d243c14
                 r = chattr_fd(f->fd, true, FS_NOCOW_FL);
d243c14
-                if (r < 0)
d243c14
-                        log_warning_errno(errno, "Failed to set file attributes: %m");
d243c14
+                if (r < 0 && r != -ENOTTY)
d243c14
+                        log_warning_errno(r, "Failed to set file attributes: %m");
d243c14
 
d243c14
                 /* Let's attach the creation time to the journal file,
d243c14
                  * so that the vacuuming code knows the age of this