summaryrefslogtreecommitdiffstats
path: root/lib/zstd/compress/zstd_lazy.c
diff options
context:
space:
mode:
authorDamien Le Moal <dlemoal@kernel.org>2025-04-13 11:24:47 +0900
committerDamien Le Moal <dlemoal@kernel.org>2025-04-22 16:06:08 +0900
commit14a3cc755825ef7b34c986aa2786ea815023e9c5 (patch)
treed15fc37f777c7a9b24c1d53236ee9a22eb9df84b /lib/zstd/compress/zstd_lazy.c
parent17e897a456752ec9c2d7afb3d9baf268b442451b (diff)
downloadlinux-14a3cc755825ef7b34c986aa2786ea815023e9c5.tar.gz
linux-14a3cc755825ef7b34c986aa2786ea815023e9c5.tar.bz2
linux-14a3cc755825ef7b34c986aa2786ea815023e9c5.zip
scsi: Improve CDL control
With ATA devices supporting the CDL feature, using CDL requires that the feature be enabled with a SET FEATURES command. This command is issued as the translated command for the MODE SELECT command issued by scsi_cdl_enable() when the user enables CDL through the device cdl_enable sysfs attribute. However, the implementation of scsi_cdl_enable() always issues a MODE SELECT command for ATA devices when the enable argument is true, even if CDL is already enabled on the device. While this does not cause any issue with using CDL descriptors with read/write commands (the CDL feature will be enabled on the drive), issuing the MODE SELECT command even when the device CDL feature is already enabled will cause a reset of the ATA device CDL statistics log page (as defined in ACS, any CDL enable action must reset the device statistics). Avoid this needless actions (and the implied statistics log page reset) by modifying scsi_cdl_enable() to issue the MODE SELECT command to enable CDL if and only if CDL is not reported as already enabled on the device. And while at it, simplify the initialization of the is_ata boolean variable and move the declaration of the scsi mode data and sense header variables to within the scope of ATA device handling. Fixes: 1b22cfb14142 ("scsi: core: Allow enabling and disabling command duration limits") Cc: stable@vger.kernel.org Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Niklas Cassel <cassel@kernel.org> Reviewed-by: Igor Pylypiv <ipylypiv@google.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'lib/zstd/compress/zstd_lazy.c')
0 files changed, 0 insertions, 0 deletions