This mainly gets around a kernel bug making it possible to
have non-existent paths in /proc/self/mountinfo, but it should also
prevent flaky failures that can happen if something changes immediately
after or during reading /proc/self/mountinfo.
Closes https://github.com/systemd/systemd/issues/8286.
int mnt_id = PTR_TO_INT(k), mnt_id2;
r = path_get_mnt_id(p, &mnt_id2);
- if (r == -EOPNOTSUPP) { /* kernel or file system too old? */
- log_debug("%s doesn't support mount IDs\n", p);
- continue;
- }
- if (IN_SET(r, -EACCES, -EPERM)) {
- log_debug("Can't access %s\n", p);
+ if (r < 0) {
+ log_debug_errno(r, "Failed to get the mnt id of %s: %m\n", p);
continue;
}