summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorzhendong chen <alex.chen@huawei.com>2014-12-17 14:37:04 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-01-27 08:29:39 -0800
commit31b6929b577d0f4594967029944ca95ef256312f (patch)
tree29c12b01b0eccf8cc58ce5f7ef61b6078e8a1a9d /drivers/md
parent3b7dd6ec0f620bf8a7a3b2e9bed89e1728e3872b (diff)
dm: fix missed error code if .end_io isn't implemented by target_type
commit 5164bece1673cdf04782f8ed3fba70743700f5da upstream. 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") Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/md')
-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 58f3927fd7c..62c51364cf9 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -899,7 +899,7 @@ static void disable_write_same(struct mapped_device *md)
static void clone_endio(struct bio *bio, int error)
{
- int r = 0;
+ int r = error;
struct dm_target_io *tio = container_of(bio, struct dm_target_io, clone);
struct dm_io *io = tio->io;
struct mapped_device *md = tio->io->md;