Skip to content

Commit c8a83a6

Browse files
jankaraaxboe
authored andcommitted
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>
1 parent 6251691 commit c8a83a6

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎drivers/block/nbd.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,10 @@ static void nbd_size_update(struct nbd_device *nbd)
288288
blk_queue_physical_block_size(nbd->disk->queue, config->blksize);
289289
set_capacity(nbd->disk, config->bytesize >> 9);
290290
if (bdev) {
291-
if (bdev->bd_disk)
291+
if (bdev->bd_disk) {
292292
bd_set_size(bdev, config->bytesize);
293-
else
293+
set_blocksize(bdev, config->blksize);
294+
} else
294295
bdev->bd_invalidated = 1;
295296
bdput(bdev);
296297
}

0 commit comments

Comments
 (0)