From: Jens Axboe Date: Wed, 7 Nov 2007 12:54:07 +0000 (+0100) Subject: ioprio: allow sys_ioprio_set() value of 0 to reset ioprio setting X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8ec680e4c3ec818efd1652f15199ed1c216ab550;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ioprio: allow sys_ioprio_set() value of 0 to reset ioprio setting Normally io priorities follow the CPU nice, unless a specific scheduling class has been set. Once that is set, there's no way to reset the behaviour to 'none' so that it follows CPU nice again. Currently passing in 0 as the ioprio class/value will return -1/EINVAL, change that to allow resetting of a set scheduling class. Signed-off-by: Jens Axboe --- diff --git a/fs/ioprio.c b/fs/ioprio.c index d6ff77e8e7ec..e4e01bc7f338 100644 --- a/fs/ioprio.c +++ b/fs/ioprio.c @@ -78,6 +78,10 @@ asmlinkage long sys_ioprio_set(int which, int who, int ioprio) if (!capable(CAP_SYS_ADMIN)) return -EPERM; break; + case IOPRIO_CLASS_NONE: + if (data) + return -EINVAL; + break; default: return -EINVAL; }