[Devel] [PATCH vz10 18/32] block: guard the cbt_list initialization with CONFIG_BLK_DEV_CBT

Konstantin Khorenko khorenko at virtuozzo.com
Fri Aug 21 19:37:04 MSK 2026


From: Eva Kurchatova <eva.kurchatova at virtuozzo.com>

request_queue::cbt_list only exists when CONFIG_BLK_DEV_CBT is enabled,
but blk_alloc_queue() initializes it unconditionally, so the build fails
without that option:

  block/blk-core.c: error: 'struct request_queue' has no member named
                    'cbt_list'

CONFIG_BLK_DEV_CBT has no default, so every configuration that does not
ask for it explicitly hits this, plain x86_64 defconfig included.

Guard the INIT_LIST_HEAD() the same way the field itself is guarded.

Fixes: e5c67003994e ("block/blk-cbt: allow multiple cbts in a single queue")
Feature: cbt: changed block tracking (for backup)
https://virtuozzo.atlassian.net/browse/VSTOR-134732
Signed-off-by: Eva Kurchatova <eva.kurchatova at virtuozzo.com>
Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 block/blk-core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/block/blk-core.c b/block/blk-core.c
index a168f2e41b7d..bcc3060de670 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -440,7 +440,9 @@ struct request_queue *blk_alloc_queue(struct queue_limits *lim, int node_id)
 	init_waitqueue_head(&q->mq_freeze_wq);
 	mutex_init(&q->mq_freeze_lock);
 
+#ifdef CONFIG_BLK_DEV_CBT
 	INIT_LIST_HEAD(&q->cbt_list);
+#endif
 
 	blkg_init_queue(q);
 
-- 
2.47.1



More information about the Devel mailing list