nvme-fix for Linux 6.16

- revert the cross-controller atomic write size validation that caused
    regressions (Christoph Hellwig)
  - fix endianness of command word prints in nvme_log_err_passthru()
    (John Garry)
  - fix callback lock for TLS handshake (Maurizio Lombardi)
  - fix misaccounting of nvme-mpath inflight I/O (Yu Kuai)
  - fix inconsistent RCU list manipulation in nvme_ns_add_to_ctrl_list()
    (Zheng Qixing)
 -----BEGIN PGP SIGNATURE-----
 
 iQI/BAABCgApFiEEgdbnc3r/njty3Iq9D55TZVIEUYMFAmh44AYLHGhjaEBsc3Qu
 ZGUACgkQD55TZVIEUYPpVxAAhHm3Arm+sVz+Q0VMgdWdQzxtkv3fi8Pt0ur1R4hQ
 xwhJE2UArGt2n6g2LXzSNHfWhl105HqMhibuDCssOPncm00Y1kkEWvW0QhlJFZ3S
 cDGZ7++KFLqk5UosSFT8TDjeHbEm1GHuWdzTFXZuE2xAYHxqQwFfLOA4+cQJ9F8X
 GeEm3eMmvXa+vB/aBHd/UjTsBwMs2lDM/YsuoNCz+D/++/ylcdk9x35vpkesyKLT
 uv3w5zwCPMKjPqLzCRCNQ2GD3lFGt+Z3kuS+w/bsGArt72W1f/nkb1ok/suogoan
 6nmTW1HsbS/wEq4AnCq7mdlBasJyZutqLTLybEOQsR4WBBFz+ygDpwvf9GwhGc1h
 F4s+qe2P6ILTaxW67rFV1m8oiOvpTxMOAX8f5D6UKLK1IsARrVsKrGOoxVOJNXZX
 9Jt92d3PeZyP/qWCYdhUHDg/McTq3kh/UUBY66bxsGCkJ1A5+7mLb5y/HLqe91f3
 EMKXFaisCjzniKayovii1bL7czhubxoaou3kbkVOdFhdA5KQlNqdTkiUEZVgxtXy
 qpQ6OJpIMPwdQL/wif2rD3jBfaZbhiZQ8j9uPfyTZSq/1JmFdebhsbmtwq6+oynq
 24LplpUI4Ckk5Q4S5ma8ITdNydCibDnUxBJGRKCJ92ya6+kG16R0q2dZwYq0dmBK
 bbA=
 =4I45
 -----END PGP SIGNATURE-----

Merge tag 'nvme-6.16-2025-07-17' of git://git.infradead.org/nvme into block-6.16

Pull NVMe fixes from Christoph:

"- revert the cross-controller atomic write size validation that caused
   regressions (Christoph Hellwig)
 - fix endianness of command word prints in nvme_log_err_passthru()
   (John Garry)
 - fix callback lock for TLS handshake (Maurizio Lombardi)
 - fix misaccounting of nvme-mpath inflight I/O (Yu Kuai)
 - fix inconsistent RCU list manipulation in nvme_ns_add_to_ctrl_list()
   (Zheng Qixing)"

* tag 'nvme-6.16-2025-07-17' of git://git.infradead.org/nvme:
  nvmet-tcp: fix callback lock for TLS handshake
  nvme: fix misaccounting of nvme-mpath inflight I/O
  nvme: revert the cross-controller atomic write size validation
  nvme: fix endianness of command word prints in nvme_log_err_passthru()
  nvme: fix inconsistent RCU list manipulation in nvme_ns_add_to_ctrl_list()
This commit is contained in:
Jens Axboe 2025-07-17 05:56:12 -06:00
commit 2680efde75
2 changed files with 13 additions and 18 deletions

View File

@ -381,12 +381,12 @@ static void nvme_log_err_passthru(struct request *req)
nr->status & NVME_SC_MASK, /* Status Code */
nr->status & NVME_STATUS_MORE ? "MORE " : "",
nr->status & NVME_STATUS_DNR ? "DNR " : "",
nr->cmd->common.cdw10,
nr->cmd->common.cdw11,
nr->cmd->common.cdw12,
nr->cmd->common.cdw13,
nr->cmd->common.cdw14,
nr->cmd->common.cdw15);
le32_to_cpu(nr->cmd->common.cdw10),
le32_to_cpu(nr->cmd->common.cdw11),
le32_to_cpu(nr->cmd->common.cdw12),
le32_to_cpu(nr->cmd->common.cdw13),
le32_to_cpu(nr->cmd->common.cdw14),
le32_to_cpu(nr->cmd->common.cdw15));
}
enum nvme_disposition {
@ -764,6 +764,10 @@ blk_status_t nvme_fail_nonready_command(struct nvme_ctrl *ctrl,
!test_bit(NVME_CTRL_FAILFAST_EXPIRED, &ctrl->flags) &&
!blk_noretry_request(rq) && !(rq->cmd_flags & REQ_NVME_MPATH))
return BLK_STS_RESOURCE;
if (!(rq->rq_flags & RQF_DONTPREP))
nvme_clear_nvme_request(rq);
return nvme_host_path_error(rq);
}
EXPORT_SYMBOL_GPL(nvme_fail_nonready_command);
@ -3537,15 +3541,6 @@ static int nvme_init_identify(struct nvme_ctrl *ctrl)
if (ret)
goto out_free;
}
if (le16_to_cpu(id->awupf) != ctrl->subsys->awupf) {
dev_err_ratelimited(ctrl->device,
"inconsistent AWUPF, controller not added (%u/%u).\n",
le16_to_cpu(id->awupf), ctrl->subsys->awupf);
ret = -EINVAL;
goto out_free;
}
memcpy(ctrl->subsys->firmware_rev, id->fr,
sizeof(ctrl->subsys->firmware_rev));
@ -4077,7 +4072,7 @@ static void nvme_ns_add_to_ctrl_list(struct nvme_ns *ns)
return;
}
}
list_add(&ns->list, &ns->ctrl->namespaces);
list_add_rcu(&ns->list, &ns->ctrl->namespaces);
}
static void nvme_alloc_ns(struct nvme_ctrl *ctrl, struct nvme_ns_info *info)

View File

@ -1928,10 +1928,10 @@ static void nvmet_tcp_alloc_queue(struct nvmet_tcp_port *port,
struct sock *sk = queue->sock->sk;
/* Restore the default callbacks before starting upcall */
read_lock_bh(&sk->sk_callback_lock);
write_lock_bh(&sk->sk_callback_lock);
sk->sk_user_data = NULL;
sk->sk_data_ready = port->data_ready;
read_unlock_bh(&sk->sk_callback_lock);
write_unlock_bh(&sk->sk_callback_lock);
if (!nvmet_tcp_try_peek_pdu(queue)) {
if (!nvmet_tcp_tls_handshake(queue))
return;