OSDN Git Service

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)
committerJens Axboe <axboe@kernel.dk>
Mon, 18 Apr 2022 12:54:09 +0000 (06:54 -0600)
commit2a852a693f8839bb877fc731ffbc9ece3a9c16d7
tree3866cd4f4e4c26a1caf7801389f72112867129f2
parent8fd6533ef3f7729e4aa29ead83844c042688615a
nbd: use the correct block_device in nbd_bdev_reset

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>
drivers/block/nbd.c