Skip to content

Commit c0d0a9f

Browse files
aaronluaxboe
authored andcommitted
block: remove test of incorrect io priority level
Ever since commit eca2040("scsi: block: ioprio: Clean up interface definition"), the macro IOPRIO_PRIO_LEVEL() will mask the level value to something between 0 and 7 so necessarily, level will always be lower than IOPRIO_NR_LEVELS(8). Remove this obsolete check. Reported-by: Kexin Wei <ys.weikexin@h3c.com> Cc: Damien Le Moal <dlemoal@kernel.org> Signed-off-by: Aaron Lu <ziqianlu@bytedance.com> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Link: https://lore.kernel.org/r/20250508083018.GA769554@bytedance Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent db492e2 commit c0d0a9f

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

block/ioprio.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,8 @@ int ioprio_check_cap(int ioprio)
4646
*/
4747
if (!capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_NICE))
4848
return -EPERM;
49-
fallthrough;
50-
/* rt has prio field too */
51-
case IOPRIO_CLASS_BE:
52-
if (level >= IOPRIO_NR_LEVELS)
53-
return -EINVAL;
5449
break;
50+
case IOPRIO_CLASS_BE:
5551
case IOPRIO_CLASS_IDLE:
5652
break;
5753
case IOPRIO_CLASS_NONE:

0 commit comments

Comments
 (0)