• Niklas Cassel's avatar
    ata: libata: Add helper ata_eh_decide_disposition() · 9526dec2
    Niklas Cassel authored
    Every time I see libata code calling scsi_check_sense(), I get confused
    why the code path that is working fine for SCSI code, is not sufficient
    for libata code.
    
    The reason is that SCSI usually gets the sense data as part of the
    completion, and will thus automatically call scsi_check_sense(), which
    will set the SCSI ML byte (if any).
    
    However, for libata queued commands, we always need to fetch the sense
    data via SCSI EH, and thus do not get the luxury of having
    scsi_check_sense() called automatically.
    
    Add a new helper, ata_eh_decide_disposition(), that has a ata_eh_ prefix
    to more clearly highlight that this is only needed for code called by EH,
    while also having a similar name to scsi_decide_disposition(), such that
    it is easier to compare the libata code with the equivalent SCSI code.
    
    Also add a big kdoc comment explaining why this helper is called/needed in
    the first place.
    Signed-off-by: default avatarNiklas Cassel <cassel@kernel.org>
    Signed-off-by: default avatarDamien Le Moal <dlemoal@kernel.org>
    9526dec2
libata-sata.c 40.3 KB