Skip to content

Commit

Permalink
ioprio: allow sys_ioprio_set() value of 0 to reset ioprio setting
Browse files Browse the repository at this point in the history
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 <jens.axboe@oracle.com>
  • Loading branch information
Jens Axboe committed Nov 7, 2007
1 parent 0e7be9e commit 8ec680e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/ioprio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 8ec680e

Please sign in to comment.