We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 00c9c96 commit 8b428f4Copy full SHA for 8b428f4
drivers/block/nbd.c
@@ -1473,7 +1473,17 @@ static int nbd_start_device(struct nbd_device *nbd)
1473
return -EINVAL;
1474
}
1475
1476
- blk_mq_update_nr_hw_queues(&nbd->tag_set, config->num_connections);
+retry:
1477
+ mutex_unlock(&nbd->config_lock);
1478
+ blk_mq_update_nr_hw_queues(&nbd->tag_set, num_connections);
1479
+ mutex_lock(&nbd->config_lock);
1480
+
1481
+ /* if another code path updated nr_hw_queues, retry until succeed */
1482
+ if (num_connections != config->num_connections) {
1483
+ num_connections = config->num_connections;
1484
+ goto retry;
1485
+ }
1486
1487
nbd->pid = task_pid_nr(current);
1488
1489
nbd_parse_flags(nbd);
0 commit comments