• Mike Snitzer's avatar
    dm: disable WRITE SAME if it fails · 7eee4ae2
    Mike Snitzer authored
    Add DM core support for disabling WRITE SAME on first failure to both
    request-based and bio-based targets.  The need to disable WRITE SAME
    stems from SCSI enabling it by default but then disabling it when it
    fails.  When SCSI does this it returns "permanent target failure, do
    not retry" using -EREMOTEIO.  Update DM core to only disable WRITE SAME
    on failure if the returned error is -EREMOTEIO.
    
    Commit f84cb8a4 ("dm mpath: disable WRITE SAME if it fails")
    implemented multipath specific disabling of WRITE SAME if it fails.
    However, as that commit detailed, the multipath-only solution doesn't go
    far enough if bio-based DM targets are stacked ontop of the
    request-based dm-multipath target (as is commonly done using dm-linear
    to support partitions on multipath devices, via kpartx).
    Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
    Acked-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    Tested-by: default avatarAlex Chen <alex.chen@huawei.com>
    7eee4ae2
dm-mpath.c 39.8 KB