From: Lennart Poettering Date: Wed, 24 Nov 2021 14:39:43 +0000 (+0100) Subject: core: normalize ioprio values we acquire from kernel X-Git-Tag: v250-rc1~163^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8b330d7d75b5dd861bb4f9abde98d517cdc77229;p=thirdparty%2Fsystemd.git core: normalize ioprio values we acquire from kernel Linux 5.15 broke API in ioprio_get(): instead of returning IOPRIO_CLASS_NONE when that's set it now returns IOPRIO_CLASS_BE, which is what this actually is (the former is just an alias for the latter with a priority value of 4). Let's hide the differences between old and new kernels here, and always normalize to what the new kernels do. --- diff --git a/src/core/execute.c b/src/core/execute.c index c30e15f6141..aa1193e0676 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -6023,7 +6023,7 @@ int exec_context_get_effective_ioprio(const ExecContext *c) { if (p < 0) return IOPRIO_DEFAULT_CLASS_AND_PRIO; - return p; + return ioprio_normalize(p); } bool exec_context_get_effective_mount_apivfs(const ExecContext *c) {