block: remove test of incorrect io priority level
PATCH v2 1/1 block: remove test of incorrect io priority level
Ever since commit eca2040972b4("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.
---
v2:
Address comments from Damien Le Moal, thanks.
- Rephrase changelog as suggested by Damien Le Moal;
- Remove an useless break for IOPRIO_CLASS_BE as suggested by Damien Le Moal.
block/ioprio.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
block/ioprio.c +1 -5
@@ -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 :
Signature · 1 line
2.39.5
Quoted 10 lines · Aaron Lu
Ever since commit
eca2040972b4("scsi: block: ioprio: Clean up interface definition"), the macroIOPRIO_PRIO_LEVEL()will mask the level value to something between 0 and 7 so necessarily, level will always be lower thanIOPRIO_NR_LEVELS(8).Remove this obsolete check.
Reported-by Kexin Wei <[email protected]>Cc Damien Le Moal <[email protected]>Signed-off-by Aaron Lu <[email protected]>
Looks good.
Signature · 2 lines
Damien Le Moal Western Digital Research
Quoted 8 lines · Aaron Lu
Ever since commit
eca2040972b4("scsi: block: ioprio: Clean up interface definition"), the macroIOPRIO_PRIO_LEVEL()will mask the level value to something between 0 and 7 so necessarily, level will always be lower thanIOPRIO_NR_LEVELS(8).Remove this obsolete check.
[...]
Applied, thanks!
[1/1] block: remove test of incorrect io priority level
(no commit info)
Best regards,
Signature · 1 line
Jens Axboe