]> git.baikalelectronics.ru Git - kernel.git/commit
nbd: reset NBD to NULL when restarting in nbd_genl_connect
authorChristoph Hellwig <hch@lst.de>
Wed, 25 Aug 2021 16:31:04 +0000 (18:31 +0200)
committerJens Axboe <axboe@kernel.dk>
Wed, 25 Aug 2021 20:20:20 +0000 (14:20 -0600)
commit6dede4686837418d15a34c0405af02e15b99476c
tree3c02a40a9915c593b978fb93765df45e8ca372a0
parenta62aa351a41a1bcd1a9a330672cafbf9c84b438e
nbd: reset NBD to NULL when restarting in nbd_genl_connect

When nbd_genl_connect restarts to wait for a disconnecting device, nbd
needs to be reset to NULL.  Do that by facoring out a helper to find
an unused device.

Fixes: dd12500996bd ("nbd: refactor device search and allocation in nbd_genl_connect")
Reported-by: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Reported-by: Hillf Danton <hdanton@sina.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20210825163108.50713-3-hch@lst.de
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/nbd.c