]> git.baikalelectronics.ru Git - kernel.git/commit
dm: disable WRITE SAME if it fails
authorMike Snitzer <snitzer@redhat.com>
Mon, 2 Jun 2014 19:50:06 +0000 (15:50 -0400)
committerMike Snitzer <snitzer@redhat.com>
Wed, 4 Jun 2014 13:45:52 +0000 (09:45 -0400)
commit1e31b1b2838c469fb62b0bb37b79b54272772861
tree4e81ea5fb259ce57ad989428dba31d503d95f342
parentb4b5c236881c2ea6b4bc994cedb8881df60dbf2e
dm: disable WRITE SAME if it fails

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 a7ca38b1 ("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: Mike Snitzer <snitzer@redhat.com>
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
Tested-by: Alex Chen <alex.chen@huawei.com>
drivers/md/dm-mpath.c
drivers/md/dm.c