]> 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)
commit1b9553a4c96bf52fcaca1c2f8e3cb543a6d27b05
tree3c02a40a9915c593b978fb93765df45e8ca372a0
parent5f05a10e8daf303ff8f029254e4430d04db76461
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: 38425c071578 ("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