• Tejun Heo's avatar
    libata: during revalidation, check n_sectors after device is configured · 6ddcd3b0
    Tejun Heo authored
    Device might be resized during ata_dev_configure() due to HPA or
    (later) ACPI _GTF.  Currently it's worked around by caching n_sectors
    before turning off HPA.  The cached original size is overwritten if
    the device is reconfigured without being hardreset - which always
    happens after configuring trasnfer mode.  If the device gets hardreset
    for some reason after that, revalidation fails with -ENODEV.
    
    This patch makes size checking more robust by moving n_sectors check
    from ata_dev_reread_id() to ata_dev_revalidate() after the device is
    fully configured.  No matter what happens during configuration, a
    device must have the same n_sectors after fully configured to be
    treated as the same device.
    Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
    Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
    6ddcd3b0
libata-core.c 169 KB