summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2019-01-14 09:48:09 +0100
committerJens Axboe <axboe@kernel.dk>2019-01-15 07:30:54 -0700
commitc8a83a6b54d0ca078de036aafb3f6af58c1dc5eb (patch)
treeb1656f6ae8edb9a2ebce5a413fb127534555b899
parent6251691a92170d3a781aaf7b5f2c31b50d669809 (diff)
downloadlinux-c8a83a6b54d0ca078de036aafb3f6af58c1dc5eb.tar.bz2
nbd: Use set_blocksize() to set device blocksize
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>
-rw-r--r--drivers/block/nbd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 08696f5f00bb..7c9a949e876b 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -288,9 +288,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);
}