nbd: factor out a helper to get nbd_config without holding 'config_lock'
authorLi Nan <linan122@huawei.com>
Thu, 16 Nov 2023 16:23:15 +0000 (00:23 +0800)
committerJens Axboe <axboe@kernel.dk>
Mon, 20 Nov 2023 17:16:44 +0000 (10:16 -0700)
commit3123ac77923341774ca3ad1196ad20bb0732bf70
tree47e0a24ba572b1bbf3d8ed8e7be6a24c4a73fda8
parent1b59860540a4018e8071dc18d4893ec389506b7d
nbd: factor out a helper to get nbd_config without holding 'config_lock'

There are no functional changes, just to make code cleaner and prepare
to fix null-ptr-dereference while accessing 'nbd->config'.

Signed-off-by: Li Nan <linan122@huawei.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Link: https://lore.kernel.org/r/20231116162316.1740402-3-linan666@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/nbd.c