lightnvm: fix off-by-one error on target initialization
authorMatias Bjørling <matias@cnexlabs.com>
Wed, 15 Feb 2017 15:25:32 +0000 (16:25 +0100)
committerJens Axboe <axboe@fb.com>
Wed, 15 Feb 2017 15:27:19 +0000 (08:27 -0700)
commit0e5ffd1cb5f7ce19f23cc829d5dc3ebb1491570f
treea1e8f48934b75dd5e7e0cd9f6c292c82f24be26b
parent0222967ba05a0a0f845f7dd54fb3da82afae024d
lightnvm: fix off-by-one error on target initialization

If one specifies the end lun id to be the absolute number of luns,
without taking zero indexing into account, the lightnvm core will pass
the off-by-one end lun id to target creation, which then panics during
nvm_ioctl_dev_create.

Signed-off-by: Matias Bjørling <matias@cnexlabs.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/lightnvm/core.c