nbd: use the correct block_device in nbd_bdev_reset
authorChristoph Hellwig <hch@lst.de>
Wed, 30 Mar 2022 05:29:03 +0000 (07:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Mar 2023 07:48:58 +0000 (08:48 +0100)
commitce4bbb2aa9d898ada14f2b3acec8ea5bf55d932e
tree020a128dd12b1f50d0f46692b7fdae48edba9b92
parent7889dfc19492c9b0d3908b5e92078d02125d2229
nbd: use the correct block_device in nbd_bdev_reset

[ Upstream commit 2a852a693f8839bb877fc731ffbc9ece3a9c16d7 ]

The bdev parameter to ->ioctl contains the block device that the ioctl
is called on, which can be the partition.  But the openers check in
nbd_bdev_reset really needs to check use the whole device, so switch to
using that.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20220330052917.2566582-2-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Stable-dep-of: e5cfefa97bcc ("block: fix scan partition for exclusively open device again")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/block/nbd.c