]> git.ipfire.org Git - thirdparty/systemd.git/commit
tmpfiles: do not mandate `STATX_ATIME` and `STATX_MTIME` 41232/head
authorIvan Shapovalov <intelfx@intelfx.name>
Fri, 20 Mar 2026 15:45:07 +0000 (16:45 +0100)
committerIvan Shapovalov <intelfx@intelfx.name>
Mon, 6 Apr 2026 20:53:00 +0000 (22:53 +0200)
commit122de8d93dbf496b0013c3aa3bc49a5dc6721ff8
tree613009e464f21d803d634216dbc1b70212c942e1
parente18b75c3f14960cc2a9e8bce7cce3bc3ed8c6114
tmpfiles: do not mandate `STATX_ATIME` and `STATX_MTIME`

Timestamps are not guaranteed to be set by `statx()`, and their presence
should not be asserted as a proxy to judge the kernel version. In
particular, `STATX_ATIME` is omitted from the return when querying a
file on a `noatime` superblock, causing spurious errors from tmpfiles.

Correctness analysis
====================

The timestamps produced by the `statx()` call in `opendir_and_stat()`
are only ever used once, in `clean_item_instance()` (lines 3148-3149)
as inputs to `dir_cleanup()`. Convert absent timestamps into
`NSEC_INFINITY` as per the previous commit.

Fixes #41227.
src/tmpfiles/tmpfiles.c