[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250508083018.GA769554@bytedance>
Date: Thu, 8 May 2025 16:30:36 +0800
From: Aaron Lu <ziqianlu@...edance.com>
To: Jens Axboe <axboe@...nel.dk>
Cc: Damien Le Moal <dlemoal@...nel.org>, Kexin Wei <ys.weikexin@....com>,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH v2] 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.
Reported-by: Kexin Wei <ys.weikexin@....com>
Cc: Damien Le Moal <dlemoal@...nel.org>
Signed-off-by: Aaron Lu <ziqianlu@...edance.com>
---
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(-)
diff --git a/block/ioprio.c b/block/ioprio.c
index 73301a261429f..f0ee2798539c0 100644
--- a/block/ioprio.c
+++ b/block/ioprio.c
@@ -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:
--
2.39.5
Powered by blists - more mailing lists