nbd: set the logical and physical blocksize properly
authorJosef Bacik <jbacik@fb.com>
Mon, 13 Feb 2017 15:39:47 +0000 (10:39 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Jan 2019 07:10:57 +0000 (08:10 +0100)
commiteb1087513a4969cb221b96d8c0e6901c9e1471b8
tree2d30532358291c35f9c59877173a06e96041ba33
parentef32aca7c63c1b144f99cf8f087be07a56931eac
nbd: set the logical and physical blocksize properly

commit e544541b0765c341174613b416d4b074fa7571c2 upstream.

We noticed when trying to do O_DIRECT to an export on the server side
that we were getting requests smaller than the 4k sectorsize of the
device.  This is because the client isn't setting the logical and
physical blocksizes properly for the underlying device.  Fix this up by
setting the queue blocksizes and then calling bd_set_size.

Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/block/nbd.c