[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241007111416.13814-1-surajsonawane0215@gmail.com>
Date: Mon, 7 Oct 2024 16:44:16 +0530
From: SurajSonawane2415 <surajsonawane0215@...il.com>
To: surajsonawane0215@...il.com,
axboe@...nel.dk
Cc: linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org,
hch@...radead.org
Subject: [PATCH V2] block: Fix elevator_get_default() to check for null q->tag_set
Fix error "block/elevator.c:569 elevator_get_default() error:
we previously assumed 'q->tag_set' could be null (see line 565)".
Since 'q->tag_set' cannot be NULL for blk-mq queues,
remove the unnecessary check in both `elevator_get_default`
and `elv_support_iosched`. This simplifies the logic and
ensures correct assumptions about 'q->tag_set' in blk-mq queues.
Signed-off-by: SurajSonawane2415 <surajsonawane0215@...il.com>
---
V1 -> V2:
- Remove unnecessary `q->tag_set` check in `elv_support_iosched` function.
- Remove `q->tag_set` check because blk-mq queues always have a valid tag set.
block/elevator.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/elevator.c b/block/elevator.c
index 4122026b1..60497e3b2 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -551,7 +551,7 @@ EXPORT_SYMBOL_GPL(elv_unregister);
static inline bool elv_support_iosched(struct request_queue *q)
{
if (!queue_is_mq(q) ||
- (q->tag_set && (q->tag_set->flags & BLK_MQ_F_NO_SCHED)))
+ (q->tag_set->flags & BLK_MQ_F_NO_SCHED))
return false;
return true;
}
@@ -562,7 +562,7 @@ static inline bool elv_support_iosched(struct request_queue *q)
*/
static struct elevator_type *elevator_get_default(struct request_queue *q)
{
- if (q->tag_set && q->tag_set->flags & BLK_MQ_F_NO_SCHED_BY_DEFAULT)
+ if (q->tag_set->flags & BLK_MQ_F_NO_SCHED_BY_DEFAULT)
return NULL;
if (q->nr_hw_queues != 1 &&
--
2.34.1
Powered by blists - more mailing lists