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

chrattr-util: return EOPNOTSUPP from chrattr_full if no other failure was observed #21906

Merged
merged 1 commit into from Dec 26, 2021

Conversation

bluca
Copy link
Member

@bluca bluca commented Dec 26, 2021

When chattr_full tries to apply flags one-by-one, and one fails,
record which errno was returned. But record EOPNOTSUPP(&friends)
only if no other error is observed, and return it only in that case
(otherwise keep returning ENOANO), so that callers can respond
appropriately to EOPNOTSUPP vs more relevant errors.
For example, this lets tmpfiles.d log at debug level when a filesystem
flag cannot be applied because the filesystem does not support it,
but at warning level if something else went wrong when applying it.
Restores logging behaviour of tmpfiles.d to pre-250.

Follow-up for: c1631ee

Fixes: #21901

… was observed

When chattr_full tries to apply flags one-by-one, and one fails,
record which errno was returned. But record EOPNOTSUPP(&friends)
only if no other error is observed, and return it only in that case
(otherwise keep returning ENOANO), so that callers can respond
appropriately to EOPNOTSUPP vs more relevant errors.
For example, this lets tmpfiles.d log at debug level when a filesystem
flag cannot be applied because the filesystem does not support it,
but at warning level if something else went wrong when applying it.
Restores logging behaviour of tmpfiles.d to pre-250.

Follow-up for: systemd@c1631ee

Fixes: systemd#21901
@bluca bluca added the tmpfiles label Dec 26, 2021
@yuwata
Copy link
Member

yuwata commented Dec 26, 2021

LGTM.

@yuwata yuwata merged commit 7c3b51c into systemd:main Dec 26, 2021
@yuwata
Copy link
Member

yuwata commented Dec 26, 2021

Needs to be backported to v250-stable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

Cannot set file attributes for '/var/log/journal', maybe due to incompatibility in specified attributes
4 participants