Repository navigation
Closed
Description
systemd version the issue has been seen with
260
Used distribution
Arch
Linux kernel version used
6.18.x
CPU architectures issue was seen on
x86_64
Component
systemd-tmpfiles
Expected behaviour you didn't see
systemd-tmpfiles must not rely on STATX_ATIME being always set if the kernel "new enough", as this flag is masked off when the filesystem is mounted with noatime.
/* allow the fs to override these if it really wants to */
/* SB_NOATIME means filesystem supplies dummy atime value */
if (inode->i_sb->s_flags & SB_NOATIME)
stat->result_mask &= ~STATX_ATIME;Unexpected behaviour you saw
systemd-tmpfiles uses STATX_ATIME as a "mandatory" flag, expecting it to be always set in a well-formed environment, and emitting an error if it is not set suggesting that the environment is broken when it in fact isn't:
systemd/src/tmpfiles/tmpfiles.c
Lines 589 to 598 in 3e52279
| r = xstatx_full(dirfd(d), | |
| /* path= */ NULL, | |
| AT_EMPTY_PATH, | |
| /* xstatx_flags= */ 0, | |
| STATX_MODE|STATX_INO|STATX_ATIME|STATX_MTIME, | |
| /* optional_mask= */ 0, | |
| STATX_ATTR_MOUNT_ROOT, | |
| &sx); | |
| if (r < 0) | |
| return log_error_errno(r, "statx(%s) failed: %m", path); |
leading to
Lines 377 to 385 in 3e52279
| if (!FLAGS_SET(sx.stx_mask, mandatory_mask)) { | |
| if (DEBUG_LOGGING) { | |
| _cleanup_free_ char *mask_str = statx_mask_to_string(mandatory_mask & ~sx.stx_mask); | |
| log_debug("statx() does not support '%s' mask (running on an old kernel?)", strnull(mask_str)); | |
| } | |
| return -EUNATCH; | |
| } | |
Steps to reproduce the problem
- set up a rootfs on a filesystem with
noatime - boot using systemd
- observe
systemd-tmpfiles-clean.servicefailing
Additional program output to the terminal or log subsystem illustrating the issue
# SYSTEMD_LOG_LEVEL=debug systemd-tmpfiles --clean
<...>
Running clean action for entry X /var/tmp/systemd-private-94cc8a77688e497f96d5b9019e66ed6f-*/tmp
statx() does not support 'STATX_ATIME' mask (running on an old kernel?)
statx(/var/tmp/systemd-private-94cc8a77688e497f96d5b9019e66ed6f-prometheus-smartctl-exporter.service-GKguQK/tmp) failed: Protocol driver not attached
statx() does not support 'STATX_ATIME' mask (running on an old kernel?)
statx(/var/tmp/systemd-private-94cc8a77688e497f96d5b9019e66ed6f-systemd-logind.service-k8j52T/tmp) failed: Protocol driver not attached
statx() does not support 'STATX_ATIME' mask (running on an old kernel?)
statx(/var/tmp/systemd-private-94cc8a77688e497f96d5b9019e66ed6f-irqbalance.service-7RJkev/tmp) failed: Protocol driver not attached
statx() does not support 'STATX_ATIME' mask (running on an old kernel?)
statx(/var/tmp/systemd-private-94cc8a77688e497f96d5b9019e66ed6f-chronyd.service-8hkO5G/tmp) failed: Protocol driver not attached
statx() does not support 'STATX_ATIME' mask (running on an old kernel?)
statx(/var/tmp/systemd-private-94cc8a77688e497f96d5b9019e66ed6f-dbus-broker.service-6P6LVl/tmp) failed: Protocol driver not attached
statx() does not support 'STATX_ATIME' mask (running on an old kernel?)
statx(/var/tmp/systemd-private-94cc8a77688e497f96d5b9019e66ed6f-nginx.service-B5HX8B/tmp) failed: Protocol driver not attached
Running clean action for entry x /var/tmp/systemd-private-94cc8a77688e497f96d5b9019e66ed6f-*
Running clean action for entry q /var/tmp
statx() does not support 'STATX_ATIME' mask (running on an old kernel?)
statx(/var/tmp) failed: Protocol driver not attached
<...>
Activity
tmpfiles: do not mandate `STATX_ATIME` and `STATX_MTIME`
tmpfiles: do not mandate `STATX_ATIME` and `STATX_MTIME`
tmpfiles: do not require `STATX_ATIME` (#41232)
tmpfiles: do not mandate `STATX_ATIME` and `STATX_MTIME`
mbartosi commentedon May 7, 2026
I can confirm this also happens on stable Gentoo now:
maj 07 07:59:08 lat9330 systemd[1]: Starting Cleanup of Temporary Directories...
maj 07 07:59:09 lat9330 systemd-tmpfiles[11391]: statx(/var/cache/man) failed: Protocol driver not attached
maj 07 07:59:09 lat9330 systemd-tmpfiles[11391]: statx(/var/lib/systemd/pstore) failed: Protocol driver not attached
maj 07 07:59:09 lat9330 systemd-tmpfiles[11391]: statx(/var/lib/systemd/ephemeral-trees) failed: Protocol driver not attached
maj 07 07:59:09 lat9330 systemd-tmpfiles[11391]: statx(/var/lib/systemd/coredump) failed: Protocol driver not attached
maj 07 07:59:09 lat9330 systemd-tmpfiles[11391]: statx(/var/tmp/systemd-private-0181b75034d14179867cb16f3074538f-systemd-logind.service-thnuno/tmp) failed: Protocol driver not attached
maj 07 07:59:09 lat9330 systemd-tmpfiles[11391]: statx(/var/tmp) failed: Protocol driver not attached
maj 07 07:59:09 lat9330 systemd[1]: systemd-tmpfiles-clean.service: Main process exited, code=exited, status=73/CANTCREAT
maj 07 07:59:09 lat9330 systemd[1]: systemd-tmpfiles-clean.service: Failed with result 'exit-code'.
maj 07 07:59:09 lat9330 systemd[1]: Failed to start Cleanup of Temporary Directories.