mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 00:04:15 +08:00
block-5.11-2021-01-16
-----BEGIN PGP SIGNATURE----- iQJEBAABCAAuFiEEwPw5LcreJtl1+l5K99NY+ylx4KYFAmADKbkQHGF4Ym9lQGtl cm5lbC5kawAKCRD301j7KXHgpgrWD/9gmAaxW3cF5K9UPcfT9VRz50PRfa5cGNwu eQ3ETIkqQtmizibj9BXBYwPWn6FK6gSeI8LjP0SXOUxkG1O23Hwwb6ieQ2tRg+CX Wmb+S7EUwpkHBWWmulfsX9PXQsyG2D4oz8Obxwp0jvI3XzuEeMQ5gYTpO+0YTxi1 VgdeOZfV5Xben0kvpwlUfowdOD6CK8LSPJ4KjuynkvgtfKuipsCmJqMqRZqFMu3f F4p+ngVYuqEcKddh+h5pFifUy2bo076eYe4kE6vGlmdySjaVyHiLJcBmkMDxb/cp daWTaBGCsvZfP0uwLgATD0P0UqJn44Vx15FlN50uSlrfaEiglO6aBuWwbQpuPpq/ FF/hhUscs9cmZhYGO8TNnOZHfzNmYmPx9dH/D+Fo6mqCaGvsOyGGUeKuG86hfLlM AEVGFiVdlQNdLq7f2HHFKfWL1XvHbvGrgQ5d4dnJrD9a/1TgXTiluleC1+vvLfoP cRTATNtfMTcc88QF+L1BxtHXkUsf6dyqPt1AalmKqwHDv9d1C/B0aZt6a/JFTXp4 utsxDi+WOb4HVT4/ojl35HML6CWATqVgHH1rSG2Q8UPWvLX+O8QalRIBhtNaRt9k hr3joKlmeyCjJdrgE+07xlwfiqTmmhmTkGjJw39KyQTiOyyEPey+HWwJEhO1QaFR hgoQvLA4mw== =CYyj -----END PGP SIGNATURE----- Merge tag 'block-5.11-2021-01-16' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: "Just an nvme pull request via Christoph: - don't initialize hwmon for discover controllers (Sagi Grimberg) - fix iov_iter handling in nvme-tcp (Sagi Grimberg) - fix a preempt warning in nvme-tcp (Sagi Grimberg) - fix a possible NULL pointer dereference in nvme (Israel Rukshin)" * tag 'block-5.11-2021-01-16' of git://git.kernel.dk/linux-block: nvme: don't intialize hwmon for discovery controllers nvme-tcp: fix possible data corruption with bio merges nvme-tcp: Fix warning with CONFIG_DEBUG_PREEMPT nvmet-rdma: Fix NULL deref when setting pi_enable and traddr INADDR_ANY
This commit is contained in:
commit
54c6247d06
@ -2856,6 +2856,11 @@ static const struct attribute_group *nvme_subsys_attrs_groups[] = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
static inline bool nvme_discovery_ctrl(struct nvme_ctrl *ctrl)
|
||||
{
|
||||
return ctrl->opts && ctrl->opts->discovery_nqn;
|
||||
}
|
||||
|
||||
static bool nvme_validate_cntlid(struct nvme_subsystem *subsys,
|
||||
struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id)
|
||||
{
|
||||
@ -2875,7 +2880,7 @@ static bool nvme_validate_cntlid(struct nvme_subsystem *subsys,
|
||||
}
|
||||
|
||||
if ((id->cmic & NVME_CTRL_CMIC_MULTI_CTRL) ||
|
||||
(ctrl->opts && ctrl->opts->discovery_nqn))
|
||||
nvme_discovery_ctrl(ctrl))
|
||||
continue;
|
||||
|
||||
dev_err(ctrl->device,
|
||||
@ -3144,7 +3149,7 @@ int nvme_init_identify(struct nvme_ctrl *ctrl)
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
if (!ctrl->opts->discovery_nqn && !ctrl->kas) {
|
||||
if (!nvme_discovery_ctrl(ctrl) && !ctrl->kas) {
|
||||
dev_err(ctrl->device,
|
||||
"keep-alive support is mandatory for fabrics\n");
|
||||
ret = -EINVAL;
|
||||
@ -3184,7 +3189,7 @@ int nvme_init_identify(struct nvme_ctrl *ctrl)
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (!ctrl->identified) {
|
||||
if (!ctrl->identified && !nvme_discovery_ctrl(ctrl)) {
|
||||
ret = nvme_hwmon_init(ctrl);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
@ -201,7 +201,7 @@ static inline size_t nvme_tcp_req_cur_offset(struct nvme_tcp_request *req)
|
||||
|
||||
static inline size_t nvme_tcp_req_cur_length(struct nvme_tcp_request *req)
|
||||
{
|
||||
return min_t(size_t, req->iter.bvec->bv_len - req->iter.iov_offset,
|
||||
return min_t(size_t, iov_iter_single_seg_count(&req->iter),
|
||||
req->pdu_len - req->pdu_sent);
|
||||
}
|
||||
|
||||
@ -286,7 +286,7 @@ static inline void nvme_tcp_queue_request(struct nvme_tcp_request *req,
|
||||
* directly, otherwise queue io_work. Also, only do that if we
|
||||
* are on the same cpu, so we don't introduce contention.
|
||||
*/
|
||||
if (queue->io_cpu == smp_processor_id() &&
|
||||
if (queue->io_cpu == __smp_processor_id() &&
|
||||
sync && empty && mutex_trylock(&queue->send_mutex)) {
|
||||
queue->more_requests = !last;
|
||||
nvme_tcp_send_all(queue);
|
||||
|
@ -1220,6 +1220,14 @@ nvmet_rdma_find_get_device(struct rdma_cm_id *cm_id)
|
||||
}
|
||||
ndev->inline_data_size = nport->inline_data_size;
|
||||
ndev->inline_page_count = inline_page_count;
|
||||
|
||||
if (nport->pi_enable && !(cm_id->device->attrs.device_cap_flags &
|
||||
IB_DEVICE_INTEGRITY_HANDOVER)) {
|
||||
pr_warn("T10-PI is not supported by device %s. Disabling it\n",
|
||||
cm_id->device->name);
|
||||
nport->pi_enable = false;
|
||||
}
|
||||
|
||||
ndev->device = cm_id->device;
|
||||
kref_init(&ndev->ref);
|
||||
|
||||
@ -1855,14 +1863,6 @@ static int nvmet_rdma_enable_port(struct nvmet_rdma_port *port)
|
||||
goto out_destroy_id;
|
||||
}
|
||||
|
||||
if (port->nport->pi_enable &&
|
||||
!(cm_id->device->attrs.device_cap_flags &
|
||||
IB_DEVICE_INTEGRITY_HANDOVER)) {
|
||||
pr_err("T10-PI is not supported for %pISpcs\n", addr);
|
||||
ret = -EINVAL;
|
||||
goto out_destroy_id;
|
||||
}
|
||||
|
||||
port->cm_id = cm_id;
|
||||
return 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user