• Mike Christie's avatar
    scsi: sd: Have midlayer retry read_capacity_10() errors · 0f11328f
    Mike Christie authored
    This has read_capacity_10() have the SCSI midlayer retry errors instead of
    driving them itself.
    
    There are 2 behavior changes with this patch:
    
     1. There is one behavior change where we no longer retry when
        scsi_execute_cmd() returns < 0, but we should be ok. We don't need to
        retry for failures like the queue being removed, and for the case where
        there are no tags/reqs since the block layer waits/retries for us. For
        possible memory allocation failures from blk_rq_map_kern() we use
        GFP_NOIO, so retrying will probably not help.
    
     2. For the specific UAs we checked for and retried, we would get
        READ_CAPACITY_RETRIES_ON_RESET retries plus whatever retries were left
        from the main loop's retries. Each UA now gets
        READ_CAPACITY_RETRIES_ON_RESET retries, and the other errors get up to
        3 retries. This is most likely ok, because
        READ_CAPACITY_RETRIES_ON_RESET is already 10 and is not based on
        anything specific like a spec or device, so the extra 3 we got from the
        main loop was probably just an accident and is not going to help.
    Signed-off-by: default avatarMike Christie <michael.christie@oracle.com>
    Link: https://lore.kernel.org/r/20240123002220.129141-16-michael.christie@oracle.comAcked-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    0f11328f
sd.c 108 KB