[3.16.y-ckt stable] Patch "dm: fix missed error code if .end_io isn't implemented by target_type" has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Wed Jan 7 10:32:17 UTC 2015


This is a note to let you know that I have just added a patch titled

    dm: fix missed error code if .end_io isn't implemented by target_type

to the linux-3.16.y-queue branch of the 3.16.y-ckt extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.16.y-queue

This patch is scheduled to be released in version 3.16.7-ckt4.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.16.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

>From 7c111775e3a64c7739389e25560af3f0222613fc Mon Sep 17 00:00:00 2001
From: zhendong chen <alex.chen at huawei.com>
Date: Wed, 17 Dec 2014 14:37:04 +0800
Subject: 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 at huawei.com>
Signed-off-by: Mike Snitzer <snitzer at redhat.com>
Fixes: 7eee4ae2db ("dm: disable WRITE SAME if it fails")
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
 drivers/md/dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 32b958dbc499..00a6cff2fffd 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -776,7 +776,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;
--
2.1.4





More information about the kernel-team mailing list