aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzhendong chen <alex.chen@huawei.com>2014-12-17 01:37:04 -0500
committerMike Snitzer <snitzer@redhat.com>2014-12-17 12:31:13 -0500
commit5164bece1673cdf04782f8ed3fba70743700f5da (patch)
tree98355028eac1fb5f41623c95a6f1382154a240af
parent2b94e8960cc3f225dec058f27570505351f4bc13 (diff)
dm: fix missed error code if .end_io isn't implemented by target_type
In bio-based DM's clone_endio(), when target_type doesn't implement .end_io (e.g. linear) r will be always be initialized 0. So if a WRITE SAME bio fails WRITE SAME will not be disabled as intended. Fix this by initializing r to error, rather than 0, in clone_endio(). Signed-off-by: Alex Chen <alex.chen@huawei.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Fixes: 7eee4ae2db ("dm: disable WRITE SAME if it fails") Cc: stable@vger.kernel.org
-rw-r--r--drivers/md/dm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 4c06585bf165..b98cd9d84435 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -899,7 +899,7 @@ static void disable_write_same(struct mapped_device *md)
899 899
900static void clone_endio(struct bio *bio, int error) 900static void clone_endio(struct bio *bio, int error)
901{ 901{
902 int r = 0; 902 int r = error;
903 struct dm_target_io *tio = container_of(bio, struct dm_target_io, clone); 903 struct dm_target_io *tio = container_of(bio, struct dm_target_io, clone);
904 struct dm_io *io = tio->io; 904 struct dm_io *io = tio->io;
905 struct mapped_device *md = tio->io->md; 905 struct mapped_device *md = tio->io->md;