[Devel] [PATCH RH9 07/22] fs: Lower ioprio in case of ioprio_set() called from CT
Andrey Zhadchenko
andrey.zhadchenko at virtuozzo.com
Thu Oct 7 13:57:31 MSK 2021
From: Kirill Tkhai <ktkhai at virtuozzo.com>
Extracted from "Initial patch".
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
=====================================================================
Removed UBC-related code.
VZ 8 rebase part https://jira.sw.ru/browse/PSBM-127782
vz7 commit: aad7bef ("fs: Lower ioprio in case of ioprio_set() called
from CT")
Signed-off-by: Alexander Mikhalitsyn <alexander.mikhalitsyn at virtuozzo.com>
(cherry picked from vz8 commit 9cf6b4dffd4f12698f8ada7587aed977c70b439e)
Signed-off-by: Andrey Zhadchenko <andrey.zhadchenko at virtuozzo.com>
---
block/ioprio.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/block/ioprio.c b/block/ioprio.c
index 06b1b03..6820e2f 100644
--- a/block/ioprio.c
+++ b/block/ioprio.c
@@ -98,11 +98,27 @@ int ioprio_check_cap(int ioprio)
struct pid *pgrp;
kuid_t uid;
int ret;
+ int class = IOPRIO_PRIO_CLASS(ioprio);
+ int data = IOPRIO_PRIO_DATA(ioprio);
ret = ioprio_check_cap(ioprio);
if (ret)
return ret;
+ if (!ve_is_super(get_exec_env())) {
+ switch (class) {
+ case IOPRIO_CLASS_RT:
+ class = IOPRIO_CLASS_BE;
+ data = 0;
+ break;
+ case IOPRIO_CLASS_IDLE:
+ class = IOPRIO_CLASS_BE;
+ data = IOPRIO_BE_NR - 1;
+ break;
+ }
+ ioprio = IOPRIO_PRIO_VALUE(class, data);
+ }
+
ret = -ESRCH;
rcu_read_lock();
switch (which) {
--
1.8.3.1
More information about the Devel
mailing list