summaryrefslogtreecommitdiffstats
path: root/rust/helpers/helpers.c
diff options
context:
space:
mode:
authorDamien Le Moal <dlemoal@kernel.org>2025-04-11 10:42:09 +0900
committerChristoph Hellwig <hch@lst.de>2025-04-16 07:37:36 +0200
commitffe0398c7d6a38af0584d4668d3762b7a97e2275 (patch)
tree6e5c536e3cc6e5623a41ff475bdf615fbdd4bd9f /rust/helpers/helpers.c
parentb1efcc470eb30073f3dedb9a88cffa71ea75d853 (diff)
downloadlinux-ffe0398c7d6a38af0584d4668d3762b7a97e2275.tar.gz
linux-ffe0398c7d6a38af0584d4668d3762b7a97e2275.tar.bz2
linux-ffe0398c7d6a38af0584d4668d3762b7a97e2275.zip
nvmet: pci-epf: always fully initialize completion entries
For a command that is normally processed through the command request execute() function, the completion entry for the command is initialized by __nvmet_req_complete() and nvmet_pci_epf_cq_work() only needs to set the status field and the phase of the completion entry before posting the entry to the completion queue. However, for commands that are failed due to an internal error (e.g. the command data buffer allocation fails), the command request execute() function is not called and __nvmet_req_complete() is never executed for the command, leaving the command completion entry uninitialized. For such command failed before calling req->execute(), the host ends up seeing completion entries with an invalid submission queue ID and command ID. Avoid such issue by always fully initilizing a command completion entry in nvmet_pci_epf_cq_work(), setting the entry submission queue head, ID and command ID. Fixes: 0faa0fe6f90e ("nvmet: New NVMe PCI endpoint function target driver") Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Niklas Cassel <cassel@kernel.org> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'rust/helpers/helpers.c')
0 files changed, 0 insertions, 0 deletions