From: Xiubo Li <xiubli@xxxxxxxxxx> When NBD_CLEAR_SOCK with ioctl method, it will double lock the config_lock. Signed-off-by: Xiubo Li <xiubli@xxxxxxxxxx> --- drivers/block/nbd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 3d3f4255e495..b21abf134e34 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -1358,9 +1358,7 @@ static void nbd_clear_sock_ioctl(struct nbd_device *nbd, sock_shutdown(nbd); __invalidate_device(bdev, true); nbd_bdev_reset(bdev); - if (test_and_clear_bit(NBD_RT_HAS_CONFIG_REF, - &nbd->config->runtime_flags)) - nbd_config_put(nbd); + nbd_config_clear_rt_ref_and_put(nbd); } static bool nbd_is_valid_blksize(unsigned long blksize) -- 2.18.4