Skip to content
Commit 5fdb7e1b authored by Matias Bjørling's avatar Matias Bjørling Committed by Jens Axboe
Browse files

null_blk: fix wrong capacity when bs is not 512 bytes



set_capacity() sets device's capacity using 512 bytes sectors.
null_blk calculates the number of sectors by size / bs, which
set_capacity is called with. This led to null_blk exposing the
wrong number of sectors when bs is not 512 bytes.

Signed-off-by: default avatarMatias Bjørling <m@bjorling.me>
Reviewed-by: default avatarRoss Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent de65d2d2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment