mirror of https://gitee.com/openkylin/linux.git
nvme-fabrics: verify that a controller returns the correct NQN
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
49d3d50b0d
commit
b1465c6344
|
@ -872,6 +872,15 @@ nvmf_create_ctrl(struct device *dev, const char *buf, size_t count)
|
||||||
goto out_unlock;
|
goto out_unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (strcmp(ctrl->subnqn, opts->subsysnqn)) {
|
||||||
|
dev_warn(ctrl->device,
|
||||||
|
"controller returned incorrect NQN: \"%s\".\n",
|
||||||
|
ctrl->subnqn);
|
||||||
|
mutex_unlock(&nvmf_transports_mutex);
|
||||||
|
ctrl->ops->delete_ctrl(ctrl);
|
||||||
|
return ERR_PTR(-EINVAL);
|
||||||
|
}
|
||||||
|
|
||||||
mutex_unlock(&nvmf_transports_mutex);
|
mutex_unlock(&nvmf_transports_mutex);
|
||||||
return ctrl;
|
return ctrl;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue