Skip to content

Commit f068d0a

Browse files
shroffnikawasaki
authored andcommitted
null_blk: fix set->driver_data while setting up tagset
When setting up a null block device, we initialize a tagset that includes a driver_data field—typically used by block drivers to store a pointer to driver-specific data. In the case of null_blk, this should point to the struct nullb instance. However, due to recent tagset refactoring in the null_blk driver, we missed initializing driver_data when creating a shared tagset. As a result, software queues (ctx) fail to map correctly to new hardware queues (hctx). For example, increasing the number of submit queues triggers an nr_hw_queues update, which invokes null_map_queues() to remap queues. Since set->driver_data is unset, null_map_queues() fails to map any ctx to the new hctxs, leading to hctx->nr_ctx == 0, effectively making the hardware queues unusable for I/O. This patch fixes the issue by ensuring that set->driver_data is properly initialized to point to the struct nullb during tagset setup. Fixes: 72ca287 ("null_blk: refactor tag_set setup") Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Nilay Shroff <[email protected]>
1 parent 2c9471a commit f068d0a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/block/null_blk/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1856,6 +1856,7 @@ static int null_setup_tagset(struct nullb *nullb)
18561856
{
18571857
if (nullb->dev->shared_tags) {
18581858
nullb->tag_set = &tag_set;
1859+
nullb->tag_set->driver_data = nullb;
18591860
return null_init_global_tag_set();
18601861
}
18611862

0 commit comments

Comments
 (0)