]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
user-runtime-dir: skip setting quota if not requested
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 6 Aug 2025 03:42:27 +0000 (12:42 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 6 Aug 2025 03:54:23 +0000 (12:54 +0900)
Fixes the following spurious warning:

systemd-user-runtime-dir[865]: Failed to set disk quota limit to '15.9P' on /tmp for UID 991, ignoring: Numerical result out of range

Fixes #38493.

src/login/user-runtime-dir.c

index efcf36f2ccb8699baa855cc74d0edac461c41715..0de95583cb8758c8b08b545ad37b59923783c1ad 100644 (file)
@@ -210,6 +210,11 @@ static int apply_tmpfs_quota(
         assert(uid_is_valid(uid));
 
         STRV_FOREACH(p, paths) {
+                if (limit == UINT64_MAX && scale == UINT32_MAX) {
+                        log_debug("No disk quota on '%s' is requested.", *p);
+                        continue;
+                }
+
                 _cleanup_close_ int fd = open(*p, O_DIRECTORY|O_CLOEXEC);
                 if (fd < 0) {
                         log_warning_errno(errno, "Failed to open '%s' in order to set quota, ignoring: %m", *p);