]> 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)
commit30b94368b93c2c096d73795d8702c5d3171844fa
tree4e81ea5fb259ce57ad989428dba31d503d95f342
parenta3f3d8a48e4544483bac86faf6b6c6619357ef2d
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 8392efbe ("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