nvme: fix passthrough csi check
authorKeith Busch <kbusch@kernel.org>
Tue, 24 Jan 2023 21:29:14 +0000 (13:29 -0800)
committerChristoph Hellwig <hch@lst.de>
Wed, 25 Jan 2023 06:09:38 +0000 (07:09 +0100)
The namespace head saves the Command Set Indicator enum, so use that
instead of the Command Set Selected. The two values are not the same.

Fixes: 831ed60c2aca2d ("nvme: also return I/O command effects from nvme_command_effects")
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/core.c

index d307ae4d8a57521bcc2c3d9c191a41682673421b..2990ed331a1aa8bf438effb22d0e8afbbbc295fa 100644 (file)
@@ -1093,7 +1093,7 @@ u32 nvme_command_effects(struct nvme_ctrl *ctrl, struct nvme_ns *ns, u8 opcode)
        if (ns) {
                if (ns->head->effects)
                        effects = le32_to_cpu(ns->head->effects->iocs[opcode]);
-               if (ns->head->ids.csi == NVME_CAP_CSS_NVM)
+               if (ns->head->ids.csi == NVME_CSI_NVM)
                        effects |= nvme_known_nvm_effects(opcode);
                if (effects & ~(NVME_CMD_EFFECTS_CSUPP | NVME_CMD_EFFECTS_LBCC))
                        dev_warn_once(ctrl->device,