nbd: use bd_set_size when updating disk size
authorJosef Bacik <jbacik@fb.com>
Wed, 16 May 2018 18:51:19 +0000 (14:51 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Jun 2018 00:06:32 +0000 (08:06 +0800)
commit00946218ffe376ff3234ff3c81cd4193e3ca95e2
tree94d860ba868866d426d76022effcdd4ba1a041aa
parenta477d00557f59a20de6398a20808998ce97dce08
nbd: use bd_set_size when updating disk size

commit 9e2b19675d1338d2a38e99194756f2db44a081df upstream.

When we stopped relying on the bdev everywhere I broke updating the
block device size on the fly, which ceph relies on.  We can't just do
set_capacity, we also have to do bd_set_size so things like parted will
notice the device size change.

Fixes: 29eaadc ("nbd: stop using the bdev everywhere")
cc: stable@vger.kernel.org
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/block/nbd.c