diff options
author | Jan Kara <jack@suse.cz> | 2019-01-14 09:48:09 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-01-23 08:09:51 +0100 |
commit | c2912ca3f893a14fd24a6cad165acf61f4d7bc01 (patch) | |
tree | 50023f31d241ce646d9eea29819aabce81f2356b /drivers/block | |
parent | 4381a9484b4772589021c61e682177e1602b32fb (diff) | |
download | linux-stable-c2912ca3f893a14fd24a6cad165acf61f4d7bc01.tar.gz linux-stable-c2912ca3f893a14fd24a6cad165acf61f4d7bc01.tar.bz2 linux-stable-c2912ca3f893a14fd24a6cad165acf61f4d7bc01.zip |
nbd: Use set_blocksize() to set device blocksize
commit c8a83a6b54d0ca078de036aafb3f6af58c1dc5eb upstream.
NBD can update block device block size implicitely through
bd_set_size(). Make it explicitely set blocksize with set_blocksize() as
this behavior of bd_set_size() is going away.
CC: Josef Bacik <jbacik@fb.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/nbd.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index fe1414df0f33..d32cd943dff2 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -275,9 +275,10 @@ static void nbd_size_update(struct nbd_device *nbd) blk_queue_physical_block_size(nbd->disk->queue, config->blksize); set_capacity(nbd->disk, config->bytesize >> 9); if (bdev) { - if (bdev->bd_disk) + if (bdev->bd_disk) { bd_set_size(bdev, config->bytesize); - else + set_blocksize(bdev, config->blksize); + } else bdev->bd_invalidated = 1; bdput(bdev); } |