提交 12e9a6d6 编写于 作者: R Rakesh Pandit 提交者: Jens Axboe

lightnvm: if LUNs are already allocated fix return

While creating new device with NVM_DEV_CREATE if LUNs are already
allocated ioctl would return -ENOMEM which is wrong.  This patch
propagates -EBUSY from nvm_reserve_luns which is correct response.

Fixes: ade69e24 ("lightnvm: merge gennvm with core")
Reviewed-by: NFrans Klaver <fransklaver@gmail.com>
Signed-off-by: NRakesh Pandit <rakesh@tuxera.com>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 588726d3
......@@ -252,8 +252,9 @@ static int nvm_create_tgt(struct nvm_dev *dev, struct nvm_ioctl_create *create)
}
mutex_unlock(&dev->mlock);
if (nvm_reserve_luns(dev, s->lun_begin, s->lun_end))
return -ENOMEM;
ret = nvm_reserve_luns(dev, s->lun_begin, s->lun_end);
if (ret)
return ret;
t = kmalloc(sizeof(struct nvm_target), GFP_KERNEL);
if (!t) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册