Skip to content

Commit

Permalink
block: remove test of incorrect io priority level
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Aaron Lu authored and Jens Axboe committed May 8, 2025
1 parent db492e2 commit c0d0a9f
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions block/ioprio.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,8 @@ int ioprio_check_cap(int ioprio)
*/
if (!capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_NICE))
return -EPERM;
fallthrough;
/* rt has prio field too */
case IOPRIO_CLASS_BE:
if (level >= IOPRIO_NR_LEVELS)
return -EINVAL;
break;
case IOPRIO_CLASS_BE:
case IOPRIO_CLASS_IDLE:
break;
case IOPRIO_CLASS_NONE:
Expand Down

0 comments on commit c0d0a9f

Please sign in to comment.