Commit 7b9b7171 authored by Niklas Cassel's avatar Niklas Cassel Committed by sanglipeng
Browse files

ata: libata-scsi: ignore reserved bits for REPORT SUPPORTED OPERATION CODES

stable inclusion
from stable-v5.10.198
commit b664e9db8d2c5e5d4e85277acd0815802a0d76fc
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I987V5

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b664e9db8d2c5e5d4e85277acd0815802a0d76fc



--------------------------------

commit 3ef60092 upstream.

For REPORT SUPPORTED OPERATION CODES command, the service action field is
defined as bits 0-4 in the second byte in the CDB. Bits 5-7 in the second
byte are reserved.

Only look at the service action field in the second byte when determining
if the MAINTENANCE IN opcode is a REPORT SUPPORTED OPERATION CODES command.

This matches how we only look at the service action field in the second
byte when determining if the SERVICE ACTION IN(16) opcode is a READ
CAPACITY(16) command (reserved bits 5-7 in the second byte are ignored).

Fixes: 7b203094 ("libata: Add support for SCT Write Same")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarNiklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: default avatarDamien Le Moal <dlemoal@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 0498853b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment