]> git.itanic.dy.fi Git - linux-stable/commit
nvme: fix miss command type check
authormin15.li <min15.li@samsung.com>
Fri, 26 May 2023 17:06:56 +0000 (17:06 +0000)
committerKeith Busch <kbusch@kernel.org>
Tue, 30 May 2023 15:50:24 +0000 (08:50 -0700)
commit31a5978243d24d77be4bacca56c78a0fbc43b00d
treeca1c97cefc6d8979e9ba062a931e7fd42d1bfcdb
parenta3a9d63dcd15535e7fdf4c7c1b32bfaed762973a
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>
drivers/nvme/host/core.c
drivers/nvme/host/ioctl.c
drivers/nvme/host/nvme.h
drivers/nvme/target/passthru.c