Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

systemd-tmpfiles prints weird errors when setting file attributes that conflict #17690

Closed
brainpower opened this issue Nov 22, 2020 · 1 comment · Fixed by #17693
Closed

systemd-tmpfiles prints weird errors when setting file attributes that conflict #17690

brainpower opened this issue Nov 22, 2020 · 1 comment · Fixed by #17693
Labels

Comments

@brainpower
Copy link

brainpower commented Nov 22, 2020

systemd version the issue has been seen with

Arch Linux's 246.6-1

Used distribution

Arch Linux

Linux kernel version used (uname -a)

5.9.9-arch1-1

CPU architecture issue was seen on

x86-64

Expected behaviour you didn't see

systemd-tmpfiles not printing any errors

Unexpected behaviour you saw

systemd-tempfiles prints the following errors:

(2/3) Creating temporary files...
Cannot set file attribute for '/var/log/journal', value=0x00800000, mask=0x00800000, ignoring: Invalid argument
Cannot set file attribute for '/var/log/journal/1cd5XXXXXXXXXXXXXXXX32420fa', value=0x00800000, mask=0x00800000, ignoring: Invalid argument
Cannot set file attribute for '/var/log/journal/remote', value=0x00800000, mask=0x00800000, ignoring: Invalid argument

My investigation showed that these errors are only printed when compression was enabled on the directories systemd-tmpfiles tries to set the +C attribute on. Running chattr -c on the directories listed in the error messages fixed the errors.
It seems to me that compression and no CoW cannot be enabled together on btrfs.

Maybe this can be fixed by also disabling compression in master/tmpfiles.d/journal-nocow.conf, if thats possible, sensible and does not hurt on other filesystems?

The other issue here is, maybe the error messages could be improved? It took me some googling to get to the root of the issue...

Steps to reproduce the problem

Enable compression on a btrfs filesystem before systemd-tmpfiles creates /var/log/journal

EDIT: It seems this only happens if the attributes are used via chattr +c or btrfs property set ./dir compression lzo, but not when using the mount option compress=.
Sounds like there could be a btrfs bug at play here, too, but I dont think thats the case since btrfs(5) states for the nodatacow mount option: Nodatacow implies nodatasum, and disables compression.

also, showing that +c and +C seem to conflict:

% mkdir dir                                             
% lsattr                                                
-------------------- ./dir
% chattr +C dir                                         
% lsattr                                                
---------------C---- ./dir
% chattr +c dir                                         
chattr: Invalid argument while setting flags on dir
% lsattr                                                
---------------C---- ./dir
% chattr -C dir                                         
% chattr +c dir                                         
% lsattr                                                
--------c----------- ./dir
% chattr +C dir                                         
chattr: Invalid argument while setting flags on dir
% lsattr                                                
--------c----------- ./dir
yuwata added a commit to yuwata/systemd that referenced this issue Nov 23, 2020
@yuwata
Copy link
Member

yuwata commented Nov 23, 2020

Fix is waiting in #17693.

yuwata added a commit to yuwata/systemd that referenced this issue Nov 23, 2020
yuwata added a commit to yuwata/systemd that referenced this issue Nov 24, 2020
yuwata added a commit to yuwata/systemd that referenced this issue Nov 27, 2020
yuwata added a commit to yuwata/systemd that referenced this issue Dec 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants