summaryrefslogtreecommitdiff
path: root/drivers/block/nbd.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2019-01-14 11:48:09 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-01-23 10:10:57 +0300
commitf3fc88992633572bd94996f73c4f9db5988b48b5 (patch)
tree44d9ffe04ee08e74aa4385eea5cb92ded1712c5b /drivers/block/nbd.c
parenteb1087513a4969cb221b96d8c0e6901c9e1471b8 (diff)
downloadlinux-f3fc88992633572bd94996f73c4f9db5988b48b5.tar.xz
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/nbd.c')
-rw-r--r--drivers/block/nbd.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 2f4e5997cdb2..394f8ec83cf0 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -120,6 +120,7 @@ static void nbd_size_update(struct nbd_device *nbd, struct block_device *bdev)
blk_queue_logical_block_size(nbd->disk->queue, nbd->blksize);
blk_queue_physical_block_size(nbd->disk->queue, nbd->blksize);
bd_set_size(bdev, nbd->bytesize);
+ set_blocksize(bdev, nbd->blksize);
set_capacity(nbd->disk, nbd->bytesize >> 9);
kobject_uevent(&nbd_to_dev(nbd)->kobj, KOBJ_CHANGE);
}