]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
user-runtime-dir: correct quota size calculation
authorMike Yuan <me@yhndnzj.com>
Mon, 3 Feb 2025 15:18:14 +0000 (16:18 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 31 Mar 2025 20:46:04 +0000 (22:46 +0200)
Follow-up for b1c95fb2e9d11fc190017dec3d64f468f9d378bc

Fixes #36245

src/login/user-runtime-dir.c

index fb33fdd9397ce3fa7912ae47509357661f071bf3..451e181cd863703558827efea9acb02112d3fd47 100644 (file)
@@ -262,7 +262,7 @@ static int apply_tmpfs_quota(
                 uint64_t v =
                         (scale == 0) ? 0 :
                         (scale == UINT32_MAX) ? UINT64_MAX :
-                        (uint64_t) ((double) (sfs.f_blocks * sfs.f_frsize) / scale * UINT32_MAX);
+                        (uint64_t) ((double) (sfs.f_blocks * sfs.f_frsize) * scale / UINT32_MAX);
 
                 v = MIN(v, limit);
                 v /= QIF_DQBLKSIZE;