aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/nvme/host/core.c
diff options
context:
space:
mode:
authormin15.li <min15.li@samsung.com>2023-05-26 17:06:56 +0000
committerKeith Busch <kbusch@kernel.org>2023-05-30 08:50:24 -0700
commit31a5978243d24d77be4bacca56c78a0fbc43b00d (patch)
treeca1c97cefc6d8979e9ba062a931e7fd42d1bfcdb /drivers/nvme/host/core.c
parentNVMe: Add MAXIO 1602 to bogus nid list. (diff)
downloadwireguard-linux-31a5978243d24d77be4bacca56c78a0fbc43b00d.tar.xz
wireguard-linux-31a5978243d24d77be4bacca56c78a0fbc43b00d.zip
nvme: fix miss command type check
In the function nvme_passthru_end(), only the value of the command opcode is checked, without checking the command type (IO command or Admin command). When we send a Dataset Management command (The opcode of the Dataset Management command is the same as the Set Feature command), kernel thinks it is a set feature command, then sets the controller's keep alive interval, and calls nvme_keep_alive_work(). Signed-off-by: min15.li <min15.li@samsung.com> Reviewed-by: Kanchan Joshi <joshi.k@samsung.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <kbusch@kernel.org>
Diffstat (limited to 'drivers/nvme/host/core.c')
-rw-r--r--drivers/nvme/host/core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 1f0cbb77b249..c6cba1cc101c 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1115,7 +1115,7 @@ u32 nvme_passthru_start(struct nvme_ctrl *ctrl, struct nvme_ns *ns, u8 opcode)
}
EXPORT_SYMBOL_NS_GPL(nvme_passthru_start, NVME_TARGET_PASSTHRU);
-void nvme_passthru_end(struct nvme_ctrl *ctrl, u32 effects,
+void nvme_passthru_end(struct nvme_ctrl *ctrl, struct nvme_ns *ns, u32 effects,
struct nvme_command *cmd, int status)
{
if (effects & NVME_CMD_EFFECTS_CSE_MASK) {
@@ -1132,6 +1132,8 @@ void nvme_passthru_end(struct nvme_ctrl *ctrl, u32 effects,
nvme_queue_scan(ctrl);
flush_work(&ctrl->scan_work);
}
+ if (ns)
+ return;
switch (cmd->common.opcode) {
case nvme_admin_set_features: