]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ata: libata-core: Skip HPA resize for locked drives
authorTJ Adams <tadamsjr@google.com>
Mon, 6 Jul 2026 21:00:53 +0000 (14:00 -0700)
committerDamien Le Moal <dlemoal@kernel.org>
Wed, 8 Jul 2026 04:49:36 +0000 (13:49 +0900)
commit917d0a4b95ea7ba01ed6296fb808f752d5d81107
treeb65f229498b840657222cb2c9ae88e51cb5f56a8
parentcd64be0ecd399fa2b1ab60b3aaf2b2b744243467
ata: libata-core: Skip HPA resize for locked drives

Skip HPA resize in ata_hpa_resize() if the drive is security locked.
If the drive is locked, the command to read the native max address
fails with -EACCES, which currently causes the sticky quirk
ATA_QUIRK_BROKEN_HPA to be set on the device.

Setting this sticky quirk causes subsequent revalidations (after the
drive is unlocked) to bypass HPA checks, preventing the unlocked drive
from exposing its full native capacity without a reboot or device removal.

Cc: stable@vger.kernel.org
Signed-off-by: Terrence Adams <tadamsjr@google.com>
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
drivers/ata/libata-core.c